Best Python code snippet using autotest_python
beetree_test_xdot.py
Source: beetree_test_xdot.py
...67 sec_place.add_child(act_release)68 #---------------------------------------------------------------------------69 walk_tree(self.root)70 # self.pub_ = rospy.Publisher('/beetree/dot',String)71 # print self.root.generate_dot()72 # CODE FOR TESTING DELETE FUNCTIONALITY ####################################73 self.dot_widget1.set_dotcode(self.root.generate_dot())74 self.dot_widget1.zoom_to_fit()75 act_release.remove_self()76 act_grab.remove_self()77 self.dot_widget2.set_dotcode(self.root.generate_dot())78 self.dot_widget2.zoom_to_fit()79 # sec_pick_up.remove_all_children()80 act_release = NodeAction('act_release','release')81 sec_place.add_child(act_release)82 act_grab = NodeAction('act_grab','grab')83 sec_pick_up.add_child(act_grab)84 self.dot_widget3.set_dotcode(self.root.generate_dot())85 self.dot_widget3.zoom_to_fit()86 # sec_pick_move_to_bin.remove_child('sec_place')87 act_wait = NodeAction('act_wait','wait')88 act_stop = NodeAction('act_stop','stop')89 act_grab.add_sibling_after(act_wait)90 act_grab.add_sibling_before(act_stop)91 self.dot_widget4.set_dotcode(self.root.generate_dot())92 self.dot_widget4.zoom_to_fit()93 ############################################################################94 # self.dot_widget1.set_dotcode(self.root.generate_dot())95 # self.dot_widget1.zoom_to_fit()96 # act_stop = NodeAction('act_stop','stop')97 # sec_pick_up.add_child(act_stop)98 # self.dot_widget2.set_dotcode(self.root.generate_dot())99 # self.dot_widget2.zoom_to_fit()100 # act_lift.remove_self()101 # self.dot_widget3.set_dotcode(self.root.generate_dot())102 # self.dot_widget3.zoom_to_fit()103 # self.dot_widget4.set_dotcode(self.root.generate_dot())104 # self.dot_widget4.zoom_to_fit()105 # print 'Connecting'106 # self.connect(self.dot_widget,SIGNAL("clicked"), self.clicked)107 def closeEvent(self, event):108 # self.settings.setValue('size', self.size())109 # self.settings.setValue('pos', self.pos())110 event.accept()111 def clicked(self,event):112 print 'You clicked ' + event113 def clean_up(self):114 pass115 def check_ok(self):116 # self.pub_.publish(String(self.root.generate_dot()))117 if rospy.is_shutdown():118 self.clean_up()119 self.close()120 self.app_.exit()121# MAIN #########################################################################122if __name__ == '__main__':123 rospy.init_node('beetree',anonymous=True)124 app = QApplication(sys.argv)125 wrapper = BTWidget(app)126 # Running127 app.exec_()128 # Done...
demo_features.py
Source: demo_features.py
...30 top_level_plan()31 node_b = TaskTreeNode(Code("", plan_b)) # Should be plan_b.__wrapped__ but this dosent work for some reason32 node_d = TaskTreeNode(Code("", plan_d)) # Should be plan_d.__wrapped__ but this dosent work for some reason33 pycram.task.TASK_TREE.get_child_by_path("plan_a").insert_after(node_d)34 pycram.task.TASK_TREE.generate_dot().render("demos/insert/1", format=file_format, view=False)35 pycram.task.TASK_TREE.execute()36 pycram.task.TASK_TREE.generate_dot().render("demos/insert/2", format=file_format, view=False)37 pycram.task.TASK_TREE.get_child_by_path("plan_a").insert_before(node_b)38 pycram.task.TASK_TREE.generate_dot().render("demos/insert/3", format=file_format, view=False)39 pycram.task.TASK_TREE.execute()40 pycram.task.TASK_TREE.generate_dot().render("demos/insert/4", format=file_format, view=False)41 pycram.task.TASK_TREE.get_child_by_path("plan_a").delete()42 pycram.task.TASK_TREE.execute()43 pycram.task.TASK_TREE.generate_dot().render("demos/delete/after_insert", format=file_format, view=False)44 ## Not really part of the demo, but I shouldn't forget about this:45 top_level_plan()46 try:47 pycram.task.TASK_TREE.insert_after(node_d)48 except AttributeError:49 pass # Inserting at root is not supported. (Doesn't make sense really.)50def delete_demo():51 print("="*10 + " Delete Demo " + "="*10)52 top_level_plan()53 pycram.task.TASK_TREE.get_child_by_path("plan_b/plan_c.1").delete()54 pycram.task.TASK_TREE.execute()55 pycram.task.TASK_TREE.generate_dot().render("demos/delete/1", format=file_format, view=False)56 pycram.task.TASK_TREE.get_child_by_path("plan_b").delete()57 pycram.task.TASK_TREE.execute()58 pycram.task.TASK_TREE.generate_dot().render("demos/delete/2", format=file_format, view=False)59def move_demo():60 print("="*10 + " Move Demo " + "="*10)61 top_level_plan()62 node = pycram.task.TASK_TREE.get_child_by_path("plan_b/plan_c")63 move_node_to_path(node, "plan_a", 1)64 pycram.task.TASK_TREE.execute()65 pycram.task.TASK_TREE.generate_dot().render("demos/move/1", format=file_format, view=False)66 top_level_plan()67 node = pycram.task.TASK_TREE.get_child_by_path("plan_a")68 move_node_to_path(node, "plan_b/plan_c", 0)69 pycram.task.TASK_TREE.execute()70 pycram.task.TASK_TREE.generate_dot().render("demos/move/2", format=file_format, view=False)71def change_params_demo():72 print("="*10 + " Change Params Demo " + "="*10)73 top_level_plan()74 pycram.task.TASK_TREE.get_child_by_path("plan_a").code.args = ("bar",)75 pycram.task.TASK_TREE.execute()76 pycram.task.TASK_TREE.generate_dot().render("demos/change_params/1", format=file_format, view=False)77top_level_plan()78pycram.task.TASK_TREE.generate_dot().render("demos/test_plan", format=file_format)79insert_demo()80#delete_demo()81#move_demo()...
Check out the latest blogs from LambdaTest on this topic:
Before we discuss Scala testing, let us understand the fundamentals of Scala and how this programming language is a preferred choice for your development requirements.The popularity and usage of Scala are rapidly rising, evident by the ever-increasing open positions for Scala developers.
So, now that the first installment of this two fold article has been published (hence you might have an idea of what Agile Testing is not in my opinion), I’ve started feeling the pressure to explain what Agile Testing actually means to me.
Did you know that according to Statista, the number of smartphone users will reach 18.22 billion by 2025? Let’s face it, digital transformation is skyrocketing and will continue to do so. This swamps the mobile app development market with various options and gives rise to the need for the best mobile app testing tools
As a developer, checking the cross browser compatibility of your CSS properties is of utmost importance when building your website. I have often found myself excited to use a CSS feature only to discover that it’s still not supported on all browsers. Even if it is supported, the feature might be experimental and not work consistently across all browsers. Ask any front-end developer about using a CSS feature whose support is still in the experimental phase in most prominent web browsers. ????
The count of mobile users is on a steep rise. According to the research, by 2025, it is expected to reach 7.49 billion users worldwide. 70% of all US digital media time comes from mobile apps, and to your surprise, the average smartphone owner uses ten apps per day and 30 apps each month.
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!