Best Python code snippet using tempest_python
test_images_tags.py
Source:test_images_tags.py
...15from tempest.common.utils import data_utils16from tempest import test17class ImagesTagsTest(base.BaseV2ImageTest):18 @test.idempotent_id('10407036-6059-4f95-a2cd-cbbbee7ed329')19 def test_update_delete_tags_for_image(self):20 body = self.create_image(container_format='bare',21 disk_format='raw',22 visibility='private')23 image_id = body['id']24 tag = data_utils.rand_name('tag')25 self.addCleanup(self.client.delete_image, image_id)26 # Creating image tag and verify it.27 self.client.add_image_tag(image_id, tag)28 body = self.client.show_image(image_id)29 self.assertIn(tag, body['tags'])30 # Deleting image tag and verify it.31 self.client.delete_image_tag(image_id, tag)32 body = self.client.show_image(image_id)33 self.assertNotIn(tag, body['tags'])
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!!