<s> from cafe . drivers . unittest . decorators import ( <EOL> DataDrivenFixture , data_driven_test ) <EOL> from cloudcafe . blockstorage . datasets import BlockstorageDatasets <EOL> from cloudroast . blockstorage . volumes_api . integration . oscli . fixtures import ( <EOL> CinderCLI_IntegrationFixture ) <EOL> @ DataDrivenFixture <EOL> class CinderCLI_VolumeSmoke ( CinderCLI_IntegrationFixture ) : <EOL> @ data_driven_test ( BlockstorageDatasets . volume_types ( ) ) <EOL> def ddtest_create_minimum_sized_volume ( <EOL> self , volume_type_name , volume_type_id ) : <EOL> size = self . volumes . behaviors . get_configured_volume_type_property ( <EOL> "<STR_LIT>" , id_ = volume_type_id , name = volume_type_name ) <EOL> name = self . random_volume_name ( ) <EOL> resp = self . cinder . client . create ( <EOL> size = size , volume_type = volume_type_id , display_name = name ) <EOL> self . assertIsNotNone ( <EOL> resp . entity , '<STR_LIT>' ) <EOL> self . assertEquals ( <EOL> resp . return_code , <NUM_LIT:0> , "<STR_LIT>" ) <EOL> volume = resp . entity <EOL> self . addCleanup ( self . cinder . client . delete , volume . id_ ) <EOL> self . assertEqual ( <EOL> int ( size ) , int ( volume . size ) , "<STR_LIT>" ) <EOL> self . assertEqual ( <EOL> name , volume . display_name , <EOL> "<STR_LIT>" ) <EOL> @ data_driven_test ( BlockstorageDatasets . volume_types ( ) ) <EOL> def ddtest_delete_volume_by_id ( self , volume_type_name , volume_type_id ) : <EOL> size = self . volumes . behaviors . get_configured_volume_type_property ( <EOL> "<STR_LIT>" , id_ = volume_type_id , name = volume_type_name ) <EOL> volume = self . volumes . behaviors . create_available_volume ( <EOL> size = size , volume_type = volume_type_id ) <EOL> resp = self . cinder . client . delete ( volume . id_ ) <EOL> self . assertEquals ( <EOL> len ( resp . standard_out ) , <NUM_LIT:0> , <EOL> "<STR_LIT>" ) <EOL> self . addCleanup ( self . cinder . client . delete , volume . id_ ) <EOL> self . assertTrue ( <EOL> self . volumes . behaviors . delete_volume_confirmed ( <EOL> volume . id_ , size , ) , <EOL> "<STR_LIT>" . format ( volume . id_ ) ) <EOL> @ data_driven_test ( BlockstorageDatasets . volume_types ( ) ) <EOL> def ddtest_delete_volume_by_name ( self , volume_type_name , volume_type_id ) : <EOL> size = self . volumes . behaviors . get_configured_volume_type_property ( <EOL> "<STR_LIT>" , id_ = volume_type_id , name = volume_type_name ) <EOL> volume = self . volumes . behaviors . create_available_volume ( <EOL> size = size , volume_type = volume_type_id , <EOL> name = self . random_volume_name ( ) ) <EOL> resp = self . cinder . client . delete ( volume . name ) <EOL> self . assertEquals ( <EOL> len ( resp . standard_out ) , <NUM_LIT:0> , <EOL> "<STR_LIT>" ) <EOL> self . addCleanup ( self . cinder . client . delete , volume . id_ ) <EOL> self . assertTrue ( <EOL> self . volumes . behaviors . delete_volume_confirmed ( volume . name , size ) , <EOL> "<STR_LIT>" . format ( volume . id_ ) ) </s>
