Best Python code snippet using tempest_python
opensim_core.py
Source:opensim_core.py
...88 call('git checkout master')89 call('git branch %s -D' % branch_name)90def delete_branch(branch_name):91 call('git branch %s -D' % branch_name)92def delete_tag(tag_name):93 call('git tag -d %s' % tag_name)94def rename_tag(old, new):95 call('git tag %s %s' % (new, old))96 delete_tag(old)97with cd(opensim_core_dir):98 # TODO take care of pre-r6663 branches.99 # TODO just rename existing tags.100 # TODO convert_branch_to_tag('CableWrapping', 'cable-wrapping')101 # TODO convert_branch_to_tag('ModelBuilding', 'model-building')102 # TODO try to remove these branches beforehand.103 rename_tag('Release_02_04_00', '%s2.4.0' % opensim_core_tag_prefix)104 rename_tag('Release_03_00_00', '%s3.0.0' % opensim_core_tag_prefix)105 rename_tag('Release_03_01_00', '%s3.1.0' % opensim_core_tag_prefix)106 rename_tag('Release_03_02_00', '%s3.2.0' % opensim_core_tag_prefix)107 delete_branch('1728Branch')108 #delete_branch('CableWrapping')109 delete_branch('Engines')110 delete_branch('Integrator')111 delete_branch('Integrator@1105')112 delete_branch('JasonEmel485Project')113 delete_branch('JasonEmel485Project@1683')114 delete_branch('JasonEmel485Project@1741')115 delete_branch('JasonEmel485Project@1755')116 delete_branch('JasonEmel485Project@4133')117 delete_branch('ModelBuilding')118 delete_branch('OpenSim')119 delete_branch('OpenSim15')120 delete_branch('OpenSim18')121 delete_branch('OpenSim19')122 delete_branch('OpenSim20')123 delete_branch('OpenSim21')124 delete_branch('OpenSim22')125 delete_branch('OpenSim23')126 delete_branch('OpenSim23_1')127 delete_branch('OpenSim23_1_NB7')128 delete_branch('OpenSim24')129 delete_branch('OpenSim30')130 delete_branch('OpenSim30GUI')131 delete_branch('OpenSim31')132 delete_branch('OpenSimGUIProto')133 delete_branch('OpenSimWW01')134 delete_branch('OpenSim_BuiltOn_SimTK_1_1')135 delete_branch('OpenSim_BuiltOn_SimTK_1_1@1683')136 delete_branch('OpenSim_BuiltOn_SimTK_1_1@1741')137 delete_branch('OpenSim_BuiltOn_SimTK_1_1@1755')138 delete_branch('OpenSim_BuiltOn_SimTK_1_1@4056')139 delete_branch('OpenSim_exhibit')140 delete_branch('Remove_Xerces')141 delete_branch('Restructure')142 delete_branch('UseSimTKLibs')143 delete_branch('migrate2NmbltkBr')144 delete_tag('NMBLTK')145 delete_tag('NMBLTK@1095')146 delete_tag('Release0.1')147 delete_tag('Release0.1@1096')148 delete_tag('Release_00_00')149 delete_tag('Release_00_06_00')150 delete_tag('Release_00_07_08')151 delete_tag('Release_00_08_02')152 delete_tag('Release_01_00_00')153 delete_tag('Release_01_01_00')154 delete_tag('Release_01_05_05')155 delete_tag('Release_01_06_Jamboree')156 delete_tag('Release_01_07_00')157 delete_tag('Release_02_00')158 delete_tag('Release_02_00_01')159 delete_tag('Release_02_00_02')160 delete_tag('Release_02_00_Jamboree')161 delete_tag('Release_02_02_00')162 delete_tag('Release_02_02_01')163 delete_tag('Release_02_03_02')164 delete_tag('Release_03_00_Dev')165 delete_tag('Before_Directory_Restructure_2007-03-16')166 167active_branches = ['master', 'Visualizer', 'OpenSim32']168if normalize_line_endings:169 filter_branch_tasks(opensim_core_dir, active_branches)170# Make opensim-core a standalone project with a reasonably clean install.171with cd(opensim_core_dir):172 for branch in active_branches:173 myprint('Applying patch to %s' % branch)174 call('git checkout %s' % branch)175 call('git apply %s/opensim-core.patch' % homebase_dir)176 call('git commit -am"Edit CMake files to reflect split from SVN."')177 call('git checkout master')178 call('cp %s/opensim-core.travis.yml .travis.yml' % (homebase_dir))179 call('git add .travis.yml')...
test_file.py
Source:test_file.py
...89class TestTagsFile(unittest.TestCase):10 """Cette classe teste les methodes associees a la gestion des tags pour la classe File11 * add_tag(tag)12 * delete_tag(tag)13 * is_in_tags(tag)"""1415 def test_add_tag_not_yet_in_list(self):16 """add_tag(new_tag) avec new_tag ne se trouvant pas dans __tags"""17 # Les ajouts file_test.add_tag(new_tag) sont effectues dans unittest_test_file_instances et testes ici18 self.assertEqual(True, (tag1 in file_test1.tags))19 self.assertEqual(True, (tag2 in file_test1.tags))2021 self.assertEqual(True, (tag3 in file_test2.tags))22 self.assertEqual(True, (tag4 in file_test2.tags))2324 self.assertEqual(True, (tag5 in file_test3.tags))25 self.assertEqual(True, (tag6 in file_test3.tags))2627 def test_add_tag_already_in_list(self):28 """add_tag(new_tag) avec new_tag se trouvant deja dans __tags"""29 self.assertRaises(AlreadyInListException, file_test1.add_tag, tag1)30 self.assertRaises(AlreadyInListException, file_test1.add_tag, tag2)3132 self.assertRaises(AlreadyInListException, file_test2.add_tag, tag3)33 self.assertRaises(AlreadyInListException, file_test2.add_tag, tag4)3435 self.assertRaises(AlreadyInListException, file_test3.add_tag, tag5)36 self.assertRaises(AlreadyInListException, file_test3.add_tag, tag6)3738 def test_is_in_tags_with_known_tag(self):39 """is_in_tags(tag) avec tag se trouvant deja dans __tags"""40 self.assertEqual(True, file_test1.is_in_tags(tag1))41 self.assertEqual(True, file_test1.is_in_tags(tag2))4243 self.assertEqual(True, file_test2.is_in_tags(tag3))44 self.assertEqual(True, file_test2.is_in_tags(tag4))4546 self.assertEqual(True, file_test3.is_in_tags(tag5))47 self.assertEqual(True, file_test3.is_in_tags(tag6))4849 def test_is_in_tags_with_unknown_tag(self):50 """is_in_tags(tag) avec tag ne se trouvant pas dans __teachers"""51 self.assertEqual(False, file_test1.is_in_tags(tag3))52 self.assertEqual(False, file_test1.is_in_tags(tag4))53 self.assertEqual(False, file_test1.is_in_tags(tag5))54 self.assertEqual(False, file_test1.is_in_tags(tag6))5556 self.assertEqual(False, file_test2.is_in_tags(tag1))57 self.assertEqual(False, file_test2.is_in_tags(tag2))58 self.assertEqual(False, file_test2.is_in_tags(tag5))59 self.assertEqual(False, file_test2.is_in_tags(tag6))6061 self.assertEqual(False, file_test3.is_in_tags(tag1))62 self.assertEqual(False, file_test3.is_in_tags(tag2))63 self.assertEqual(False, file_test3.is_in_tags(tag3))64 self.assertEqual(False, file_test3.is_in_tags(tag4))6566 def test_delete_tag_with_known_tag(self):67 """delete_tag(tag) avec tag se trouvant deja dans __tags"""68 file_test1.delete_tag(tag1)69 file_test1.delete_tag(tag2)70 self.assertEqual(False, (tag1 in file_test1.tags))71 self.assertEqual(False, (tag2 in file_test1.tags))7273 file_test2.delete_tag(tag3)74 file_test2.delete_tag(tag4)75 self.assertEqual(False, (tag3 in file_test2.tags))76 self.assertEqual(False, (tag4 in file_test2.tags))7778 file_test3.delete_tag(tag5)79 file_test3.delete_tag(tag6)80 self.assertEqual(False, (tag5 in file_test3.tags))81 self.assertEqual(False, (tag6 in file_test3.tags))8283 # retablissement des valeurs par defaut :84 file_test1.add_tag(tag1)85 file_test1.add_tag(tag2)86 file_test2.add_tag(tag3)87 file_test2.add_tag(tag4)88 file_test3.add_tag(tag5)89 file_test3.add_tag(tag6)9091 def test_delete_tag_with_unknown_tag(self):92 """remove_teacher(name) avec name ne se trouvant pas dans __teachers"""93 self.assertRaises(NotInListException, file_test1.delete_tag, tag3)
...
urls.py
Source:urls.py
1from django.urls import path2from . import views3urlpatterns = [4 path('', views.blogs, name="blogs"),5 path('blog/<str:pk>/', views.blog, name="blog"),6 path("create_blog/", views.create_blog, name="create_blog"),7 path("update_blog/<str:pk>/", views.update_blog, name="update_blog"),8 path("delete_blog/<str:pk>/", views.delete_blog, name="delete_blog"),9 10 path("delete_tag/<str:pk>/", views.delete_tag, name="delete_tag"),...
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!!