Best Python code snippet using tempest_python
test_images.py
Source:test_images.py  
...111        body = self.client.show_image(image['id'])112        self.assertEqual(image['id'], body['id'])113        self.assertEqual(new_image_name, body['name'])114    @decorators.idempotent_id('951ebe01-969f-4ea9-9898-8a3f1f442ab0')115    def test_deactivate_reactivate_image(self):116        # Create image117        image_name = data_utils.rand_name('image')118        image = self.create_image(name=image_name,119                                  container_format='bare',120                                  disk_format='raw',121                                  visibility='private')122        # Upload an image file123        content = data_utils.random_bytes()124        image_file = six.BytesIO(content)125        self.client.store_image_file(image['id'], image_file)126        # Deactivate image127        self.client.deactivate_image(image['id'])128        body = self.client.show_image(image['id'])129        self.assertEqual("deactivated", body['status'])...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!!
