Best Python code snippet using tempest_python
test_images_metadefs_resource_types.py
Source:test_images_metadefs_resource_types.py
...16from tempest.lib import decorators17class MetadataResourceTypesTest(base.BaseV2ImageTest):18 """Test the Metadata definition resource types basic functionality"""19 @decorators.idempotent_id('6f358a4e-5ef0-11e6-a795-080027d0d606')20 def test_basic_meta_def_resource_type_association(self):21 # Get the available resource types and use one resource_type22 body = self.resource_types_client.list_resource_types()23 resource_name = body['resource_types'][0]['name']24 # Create a namespace25 namespace = self.create_namespace()26 # Create resource type association27 body = self.resource_types_client.create_resource_type_association(28 namespace['namespace'], name=resource_name)29 self.assertEqual(body['name'], resource_name)30 # NOTE(raiesmh08): Here intentionally I have not added addcleanup31 # method for resource type dissociation because its a metadata add and32 # being cleaned as soon as namespace is cleaned at test case level.33 # When namespace cleans, resource type association will automatically34 # clean without any error or dependency....
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!!