How to use test_api_version_resources method in tempest

Best Python code snippet using tempest_python

test_api_discovery.py

Source:test_api_discovery.py Github

copy

Full Screen

...17class TestApiDiscovery(base.BaseIdentityV2Test):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 2...

Full Screen

Full Screen

test_versions.py

Source:test_versions.py Github

copy

Full Screen

...16from tempest import test17class NetworksApiDiscovery(base.BaseNetworkTest):18 @test.attr(type='smoke')19 @decorators.idempotent_id('cac8a836-c2e0-4304-b556-cd299c7281d1')20 def test_api_version_resources(self):21 """Test that GET / returns expected resources.22 The versions document returned by Neutron returns a few other23 resources other than just available API versions: it also24 states the status of each API version and provides links to25 schema.26 """27 result = self.network_versions_client.list_versions()28 expected_versions = ('v2.0')29 expected_resources = ('id', 'links', 'status')30 received_list = result.values()31 for item in received_list:32 for version in item:33 for resource in expected_resources:34 self.assertIn(resource, version)...

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