How to use no_hyphen_at_end_of_rand_name method in tempest

Best Python code snippet using tempest_python

test_hacking.py

Source:test_hacking.py Github

copy

Full Screen

...61 "./patrole_tempest_plugin/tests/api/volume/fake_test_rbac.py"))62 self.assertFalse(checks.service_tags_not_in_module_path(63 "@utils.services('image')",64 "./patrole_tempest_plugin/tests/api/volume/fake_test_rbac.py"))65 def test_no_hyphen_at_end_of_rand_name(self):66 self.assertIsNone(checks.no_hyphen_at_end_of_rand_name(67 "data_utils.rand_name('test')",68 "./patrole_tempest_plugin/tests/fake_test.py"))69 self.assertIsNone(checks.no_hyphen_at_end_of_rand_name(70 "data_utils.rand_name('test')",71 "./patrole_tempest_plugin/tests/api/compute/fake_test_rbac.py"))72 self.assertIsNone(checks.no_hyphen_at_end_of_rand_name(73 "data_utils.rand_name('test')",74 "./patrole_tempest_plugin/tests/scenario/fake_test.py"))75 self.assertIsNone(checks.no_hyphen_at_end_of_rand_name(76 "data_utils.rand_name('test')",77 "./patrole_tempest_plugin/tests/unit/fake_test.py"))78 self.assertTrue(checks.no_hyphen_at_end_of_rand_name(79 "data_utils.rand_name('test-')",80 "./patrole_tempest_plugin/tests/fake_test.py"))81 self.assertTrue(checks.no_hyphen_at_end_of_rand_name(82 "data_utils.rand_name('test-')",83 "./patrole_tempest_plugin/tests/api/compute/fake_test_rbac.py"))84 self.assertTrue(checks.no_hyphen_at_end_of_rand_name(85 "data_utils.rand_name('test-')",86 "./patrole_tempest_plugin/tests/scenario/fake_test.py"))87 self.assertTrue(checks.no_hyphen_at_end_of_rand_name(88 "data_utils.rand_name('test-')",89 "./patrole_tempest_plugin/tests/unit/fake_test.py"))90 def test_no_mutable_default_args(self):91 self.assertEqual(0, len(list(checks.no_mutable_default_args(92 " def test_function(test_param_1, test_param_2"))))93 self.assertEqual(1, len(list(checks.no_mutable_default_args(94 " def test_function(test_param_1, test_param_2={}"))))95 def test_no_testtools_skip_decorator(self):96 self.assertEqual(1, len(list(checks.no_testtools_skip_decorator(97 " @testtools.skip('Bug')"))))98 self.assertEqual(0, len(list(checks.no_testtools_skip_decorator(99 " @testtools.skipTest('reason')"))))100 self.assertEqual(0, len(list(checks.no_testtools_skip_decorator(101 " @testtools.skipUnless(reason, 'message')"))))...

Full Screen

Full Screen

checks.py

Source:checks.py Github

copy

Full Screen

...80 modulepath = os.path.split(filename)[0]81 if service_name in modulepath:82 return (physical_line.find(service_name),83 "T107: service tag should not be in path")84def no_hyphen_at_end_of_rand_name(logical_line, filename):85 """Check no hyphen at the end of rand_name() argument86 T10887 """88 if './tempest/api/network/' in filename:89 # Network API tests are migrating from Tempest to Neutron repo now.90 # So here should avoid network API tests checks.91 return92 msg = "T108: hyphen should not be specified at the end of rand_name()"93 if RAND_NAME_HYPHEN_RE.match(logical_line):94 return 0, msg95def no_mutable_default_args(logical_line):96 """Check that mutable object isn't used as default argument97 N322: Method's default argument shouldn't be mutable98 """...

Full Screen

Full Screen

Automation Testing Tutorials

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.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run tempest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful