Best Python code snippet using tempest_python
test_api_discovery.py
Source:test_api_discovery.py
...18 """Tests for API discovery features."""19 @test.attr(type='smoke')20 @test.idempotent_id('ea889a68-a15f-4166-bfb1-c12456eae853')21 def test_api_version_resources(self):22 descr = self.non_admin_client.show_api_description()['version']23 expected_resources = ('id', 'links', 'media-types', 'status',24 'updated')25 keys = descr.keys()26 for res in expected_resources:27 self.assertIn(res, keys)28 @test.attr(type='smoke')29 @test.idempotent_id('007a0be0-78fe-4fdb-bbee-e9216cc17bb2')30 def test_api_media_types(self):31 descr = self.non_admin_client.show_api_description()['version']32 # Get MIME type bases and descriptions33 media_types = [(media_type['base'], media_type['type']) for34 media_type in descr['media-types']]35 # These are supported for API version 236 supported_types = [('application/json',37 'application/vnd.openstack.identity-v2.0+json')]38 # Check if supported types exist in response body39 for s_type in supported_types:40 self.assertIn(s_type, media_types)41 @test.attr(type='smoke')42 @test.idempotent_id('77fd6be0-8801-48e6-b9bf-38cdd2f253ec')43 def test_api_version_statuses(self):44 descr = self.non_admin_client.show_api_description()['version']45 status = descr['status'].lower()46 supported_statuses = ['current', 'stable', 'experimental',47 'supported', 'deprecated']...
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!!