Best Python code snippet using tempest_python
test_volume_transfers.py
Source:test_volume_transfers.py
...46 body = self.client.show_volume_transfer(transfer_id)['transfer']47 self.assertEqual(volume['id'], body['volume_id'])48 # List volume transfers, the result should be greater than49 # or equal to 150 body = self.client.list_volume_transfers()['transfers']51 self.assertThat(len(body), matchers.GreaterThan(0))52 # Accept a volume transfer by alt_tenant53 body = self.alt_client.accept_volume_transfer(54 transfer_id, auth_key=auth_key)['transfer']55 self.alt_client.wait_for_volume_status(volume['id'], 'available')56 @test.idempotent_id('ab526943-b725-4c07-b875-8e8ef87a2c30')57 def test_create_list_delete_volume_transfer(self):58 # Create a volume first59 volume = self.create_volume()60 self.addCleanup(self._delete_volume, volume['id'])61 # Create a volume transfer62 body = self.client.create_volume_transfer(63 volume_id=volume['id'])['transfer']64 transfer_id = body['id']65 self.client.wait_for_volume_status(volume['id'],66 'awaiting-transfer')67 # List all volume transfers (looking for the one we created)68 body = self.client.list_volume_transfers()['transfers']69 for transfer in body:70 if volume['id'] == transfer['volume_id']:71 break72 else:73 self.fail('Transfer not found for volume %s' % volume['id'])74 # Delete a volume transfer75 self.client.delete_volume_transfer(transfer_id)76 self.client.wait_for_volume_status(volume['id'], 'available')77class VolumesV1TransfersTest(VolumesV2TransfersTest):...
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!!