How to use list_volume_transfers method in tempest

Best Python code snippet using tempest_python

test_volume_transfers.py

Source:test_volume_transfers.py Github

copy

Full Screen

...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):...

Full Screen

Full Screen

Automation Testing Tutorials

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.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run tempest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful