Best Python code snippet using tempest_python
test_images_oneserver.py
Source:test_images_oneserver.py
...39 def _get_default_flavor_disk_size(self, flavor_id):40 flavor = self.flavors_client.show_flavor(flavor_id)['flavor']41 return flavor['disk']42 @decorators.idempotent_id('3731d080-d4c5-4872-b41a-64d0d0021314')43 def test_create_delete_image(self):44 # Create a new image45 name = data_utils.rand_name('image')46 meta = {'image_type': 'test'}47 image = self.create_image_from_server(self.server_id, name=name,48 metadata=meta,49 wait_until='ACTIVE')50 # Verify the image was created correctly51 self.assertEqual(name, image['name'])52 self.assertEqual('test', image['metadata']['image_type'])53 original_image = self.client.show_image(self.image_ref)['image']54 # Verify minRAM is the same as the original image55 self.assertEqual(image['minRam'], original_image['minRam'])56 # Verify minDisk is the same as the original image or the flavor size57 flavor_disk_size = self._get_default_flavor_disk_size(self.flavor_ref)...
test_image_requests.py
Source:test_image_requests.py
...35 params = {'id': image['id'], 'name': new_name}36 updated = self.ihelper.update_image(params)37 ok_(updated['name'] == new_name,38 'Image renaming failed. Expected name: %s. Actual: %s' % (new_name, updated['name']))39 def test_create_delete_image(self):40 # create image41 image = self.ihelper.create_image()42 ok_(image is not False, 'Image creation failed.') # create_image verifies if the image appeared in the list.43 # delete image44 ok_(self.ihelper.delete_image(image['id']),45 'Image deleting failed. Image with id=%s still exists.' % image['id'])46if __name__ == '__main__':47 t = TestImageRequests()48 t.setup_class()49 # t.test_update_image()50 # t.test_show_image()...
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!!