Best Python code snippet using tempest_python
test_image_metadata.py
Source:test_image_metadata.py
...72 resp, meta = self.client.get_image_metadata_item(self.image_id,73 'key2')74 self.assertEqual('value2', meta['key2'])75 @attr(type='gate')76 def test_set_image_metadata_item(self):77 # The value provided for the given meta item should be set for78 # the image79 meta = {'key1': 'alt'}80 resp, body = self.client.set_image_metadata_item(self.image_id,81 'key1', meta)82 resp, resp_metadata = self.client.list_image_metadata(self.image_id)83 expected = {'key1': 'alt', 'key2': 'value2'}84 self.assertEqual(expected, resp_metadata)85 @attr(type='gate')86 def test_delete_image_metadata_item(self):87 # The metadata value/key pair should be deleted from the image88 resp, body = self.client.delete_image_metadata_item(self.image_id,89 'key1')90 resp, resp_metadata = self.client.list_image_metadata(self.image_id)91 expected = {'key2': 'value2'}92 self.assertEqual(expected, resp_metadata)93 @attr(type=['negative', 'gate'])94 def test_list_nonexistant_image_metadata(self):...
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!!