Best Python code snippet using avocado_python
test_saml.py
Source:test_saml.py
...8 self.app = self.client.applications.create({9 'name': self.app_name,10 'description': 'test app'11 })12 def test_build_default_url(self):13 saml_idp_url_builder = SamlIdpUrlBuilder(self.app)14 url = saml_idp_url_builder.build()15 self.assertTrue('accessToken' in url)16 token = url.split('accessToken=')[1]17 result = jwt.decode(token, self.app._client.auth.secret)18 self.assertTrue('iss' in result.keys())19 self.assertTrue('iat' in result.keys())20 self.assertTrue('jti' in result.keys())21 def test_build_uri_with_options(self):22 options = {23 'cb_uri': 'http://some_cb_uri.com/',24 'ash': 'ash',25 'onk': 'onk',26 'state': 'state'...
test_utils_kernel.py
Source:test_utils_kernel.py
...3class TestKernelBuild(unittest.TestCase):4 def setUp(self):5 self.kernel_version = '4.4.133'6 self.kernel = KernelBuild(self.kernel_version)7 def test_build_default_url(self):8 expected_url = 'https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.4.133.tar.gz'9 self.assertEqual(self.kernel._build_kernel_url(), expected_url)10 def test_build_overrided_url(self):11 base_url = 'https://mykernel.com/'12 expected_url = '{}linux-4.4.133.tar.gz'.format(base_url)13 self.assertEqual(self.kernel._build_kernel_url(base_url=base_url), expected_url)14 def tearDown(self):15 # To make sure that the temporary workdir is cleaned up...
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!!