Best Python code snippet using tempest_python
assisted_volume_snapshots_client.py
Source:assisted_volume_snapshots_client.py
...30 resp, body = self.delete("os-assisted-volume-snapshots/%s?%s"31 % (snapshot_id,32 urllib.urlencode(query_param)))33 return rest_client.ResponseBody(resp, body)34 def create_assisted_volume_snapshot(self, volume_id, snapshot_id,35 **kwargs):36 """Create a new assisted volume snapshot.37 For a full list of available parameters, please refer to the official38 API reference:39 https://docs.openstack.org/api-ref/compute/#create-assisted-volume-snapshots40 :param volume_id: the source volume ID41 :param snapshot_id: the UUID for a snapshot42 :param type: Type of snapshot, such as qcow243 :param new_file: The name of image file that will be created44 """45 url = "os-assisted-volume-snapshots"46 info = {"snapshot_id": snapshot_id}47 if kwargs:48 info.update(kwargs)...
test_assisted_volume_snapshots_client.py
Source:test_assisted_volume_snapshots_client.py
...23 super(TestVolumesClient, self).setUp()24 fake_auth = fake_auth_provider.FakeAuthProvider()25 self.client = assisted_volume_snapshots_client.\26 AssistedVolumeSnapshotsClient(fake_auth, 'compute', 'regionOne')27 def _test_create_assisted_volume_snapshot(self, bytes_body=False):28 kwargs = {"type": "qcow2", "new_file": "fake_name"}29 self.check_service_client_function(30 self.client.create_assisted_volume_snapshot,31 'tempest.lib.common.rest_client.RestClient.post',32 {"snapshot": self.FAKE_SNAPSHOT},33 bytes_body, status=200, volume_id=self.FAKE_SNAPSHOT['volumeId'],34 snapshot_id=self.FAKE_SNAPSHOT['id'], **kwargs)35 def test_create_assisted_volume_snapshot_with_str_body(self):36 self._test_create_assisted_volume_snapshot()37 def test_create_assisted_volume_snapshot_with_byte_body(self):38 self._test_create_assisted_volume_snapshot(bytes_body=True)39 def test_delete_assisted_volume_snapshot(self):40 self.check_service_client_function(41 self.client.delete_assisted_volume_snapshot,42 'tempest.lib.common.rest_client.RestClient.delete',43 {}, status=204, volume_id=self.FAKE_SNAPSHOT['volumeId'],...
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!!