Best Python code snippet using tempest_python
test_snapshots_actions.py
Source:test_snapshots_actions.py
...52 snapshot_id = self.snapshot['id']53 self.admin_snapshots_client.reset_snapshot_status(snapshot_id,54 status)55 super(SnapshotsActionsTest, self).tearDown()56 def _get_progress_alias(self):57 return 'os-extended-snapshot-attributes:progress'58 @attr(type='gate')59 def test_reset_snapshot_status(self):60 # Reset snapshot status to creating61 status = 'creating'62 resp, body = self.admin_snapshots_client.\63 reset_snapshot_status(self.snapshot['id'], status)64 self.assertEqual(202, resp.status)65 resp_get, snapshot_get \66 = self.admin_snapshots_client.get_snapshot(self.snapshot['id'])67 self.assertEqual(200, resp_get.status)68 self.assertEqual(status, snapshot_get['status'])69 @attr(type='gate')70 def test_update_snapshot_status(self):71 # Reset snapshot status to creating72 status = 'creating'73 self.admin_snapshots_client.\74 reset_snapshot_status(self.snapshot['id'], status)75 # Update snapshot status to error76 progress = '80%'77 status = 'error'78 progress_alias = self._get_progress_alias()79 resp, body = self.client.update_snapshot_status(self.snapshot['id'],80 status, progress)81 self.assertEqual(202, resp.status)82 resp_get, snapshot_get \83 = self.admin_snapshots_client.get_snapshot(self.snapshot['id'])84 self.assertEqual(200, resp_get.status)85 self.assertEqual(status, snapshot_get['status'])86 self.assertEqual(progress, snapshot_get[progress_alias])87class SnapshotsActionsTestXML(SnapshotsActionsTest):88 _interface = "xml"89 def _get_progress_alias(self):90 return '{http://docs.openstack.org/volume/ext' \...
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!!