How to use dont_import_local_tempest_into_lib method in tempest

Best Python code snippet using tempest_python

test_hacking.py

Source:test_hacking.py Github

copy

Full Screen

...131 " @testtools.skipUnless(CONF.something, 'msg')"))))132 self.assertEqual(0, len(list(checks.no_testtools_skip_decorator(133 " @testtools.skipIf(CONF.something, 'msg')"))))134 def test_dont_import_local_tempest_code_into_lib(self):135 self.assertEqual(0, len(list(checks.dont_import_local_tempest_into_lib(136 "from tempest.common import waiters",137 './tempest/common/compute.py'))))138 self.assertEqual(0, len(list(checks.dont_import_local_tempest_into_lib(139 "from tempest import config",140 './tempest/common/compute.py'))))141 self.assertEqual(0, len(list(checks.dont_import_local_tempest_into_lib(142 "import tempest.exception",143 './tempest/common/compute.py'))))144 self.assertEqual(1, len(list(checks.dont_import_local_tempest_into_lib(145 "from tempest.common import waiters",146 './tempest/lib/common/compute.py'))))147 self.assertEqual(1, len(list(checks.dont_import_local_tempest_into_lib(148 "from tempest import config",149 './tempest/lib/common/compute.py'))))150 self.assertEqual(1, len(list(checks.dont_import_local_tempest_into_lib(151 "import tempest.exception",152 './tempest/lib/common/compute.py'))))153 def test_dont_use_config_in_tempest_lib(self):154 self.assertFalse(list(checks.dont_use_config_in_tempest_lib(155 'from tempest import config', './tempest/common/compute.py')))156 self.assertFalse(list(checks.dont_use_config_in_tempest_lib(157 'from oslo_concurrency import lockutils',158 './tempest/lib/auth.py')))159 self.assertTrue(list(checks.dont_use_config_in_tempest_lib(160 'from tempest import config', './tempest/lib/auth.py')))161 self.assertTrue(list(checks.dont_use_config_in_tempest_lib(162 'from oslo_config import cfg', './tempest/lib/decorators.py')))163 self.assertTrue(list(checks.dont_use_config_in_tempest_lib(164 'import tempest.config', './tempest/lib/common/rest_client.py')))

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