How to use list_image_metadata method in tempest

Best Python code snippet using tempest_python

test_image_metadata.py

Source:test_image_metadata.py Github

copy

Full Screen

...49 super(ImagesMetadataTestJSON, self).setUp()50 meta = {'os_version': 'value1', 'os_distro': 'value2'}51 self.client.set_image_metadata(self.image_id, meta)52 @test.idempotent_id('37ec6edd-cf30-4c53-bd45-ae74db6b0531')53 def test_list_image_metadata(self):54 # All metadata key/value pairs for an image should be returned55 resp_metadata = self.client.list_image_metadata(self.image_id)56 expected = {'metadata': {57 'os_version': 'value1', 'os_distro': 'value2'}}58 self.assertEqual(expected, resp_metadata)59 @test.idempotent_id('ece7befc-d3ce-42a4-b4be-c3067a418c29')60 def test_set_image_metadata(self):61 # The metadata for the image should match the new values62 req_metadata = {'os_version': 'value2', 'architecture': 'value3'}63 self.client.set_image_metadata(self.image_id,64 req_metadata)65 resp_metadata = (self.client.list_image_metadata(self.image_id)66 ['metadata'])67 self.assertEqual(req_metadata, resp_metadata)68 @test.idempotent_id('7b491c11-a9d5-40fe-a696-7f7e03d3fea2')69 def test_update_image_metadata(self):70 # The metadata for the image should match the updated values71 req_metadata = {'os_version': 'alt1', 'architecture': 'value3'}72 self.client.update_image_metadata(self.image_id,73 req_metadata)74 resp_metadata = self.client.list_image_metadata(self.image_id)75 expected = {'metadata': {76 'os_version': 'alt1',77 'os_distro': 'value2',78 'architecture': 'value3'}}79 self.assertEqual(expected, resp_metadata)80 @test.idempotent_id('4f5db52f-6685-4c75-b848-f4bb363f9aa6')81 def test_get_image_metadata_item(self):82 # The value for a specific metadata key should be returned83 meta = self.client.show_image_metadata_item(self.image_id,84 'os_distro')['meta']85 self.assertEqual('value2', meta['os_distro'])86 @test.idempotent_id('f2de776a-4778-4d90-a5da-aae63aee64ae')87 def test_set_image_metadata_item(self):88 # The value provided for the given meta item should be set for89 # the image90 meta = {'os_version': 'alt'}91 self.client.set_image_metadata_item(self.image_id,92 'os_version', meta)93 resp_metadata = self.client.list_image_metadata(self.image_id)94 expected = {'metadata': {'os_version': 'alt', 'os_distro': 'value2'}}95 self.assertEqual(expected, resp_metadata)96 @test.idempotent_id('a013796c-ba37-4bb5-8602-d944511def14')97 def test_delete_image_metadata_item(self):98 # The metadata value/key pair should be deleted from the image99 self.client.delete_image_metadata_item(self.image_id,100 'os_version')101 resp_metadata = self.client.list_image_metadata(self.image_id)102 expected = {'metadata': {'os_distro': 'value2'}}...

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