<s> import six <EOL> from cinderclient . v2 import availability_zones <EOL> from cinderclient . v2 import shell <EOL> from cinderclient . tests . unit . fixture_data import client <EOL> from cinderclient . tests . unit . fixture_data import availability_zones as azfixture <EOL> from cinderclient . tests . unit import utils <EOL> class AvailabilityZoneTest ( utils . FixturedTestCase ) : <EOL> client_fixture_class = client . V2 <EOL> data_fixture_class = azfixture . Fixture <EOL> def _assertZone ( self , zone , name , status ) : <EOL> self . assertEqual ( name , zone . zoneName ) <EOL> self . assertEqual ( status , zone . zoneState ) <EOL> def test_list_availability_zone ( self ) : <EOL> zones = self . cs . availability_zones . list ( detailed = False ) <EOL> self . assert_called ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> self . _assert_request_id ( zones ) <EOL> for zone in zones : <EOL> self . assertIsInstance ( zone , <EOL> availability_zones . AvailabilityZone ) <EOL> self . assertEqual ( <NUM_LIT:2> , len ( zones ) ) <EOL> l0 = [ six . u ( '<STR_LIT>' ) , six . u ( '<STR_LIT>' ) ] <EOL> l1 = [ six . u ( '<STR_LIT>' ) , six . u ( '<STR_LIT>' ) ] <EOL> z0 = shell . _treeizeAvailabilityZone ( zones [ <NUM_LIT:0> ] ) <EOL> z1 = shell . _treeizeAvailabilityZone ( zones [ <NUM_LIT:1> ] ) <EOL> self . assertEqual ( ( <NUM_LIT:1> , <NUM_LIT:1> ) , ( len ( z0 ) , len ( z1 ) ) ) <EOL> self . _assertZone ( z0 [ <NUM_LIT:0> ] , l0 [ <NUM_LIT:0> ] , l0 [ <NUM_LIT:1> ] ) <EOL> self . _assertZone ( z1 [ <NUM_LIT:0> ] , l1 [ <NUM_LIT:0> ] , l1 [ <NUM_LIT:1> ] ) <EOL> def test_detail_availability_zone ( self ) : <EOL> zones = self . cs . availability_zones . list ( detailed = True ) <EOL> self . assert_called ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> self . _assert_request_id ( zones ) <EOL> for zone in zones : <EOL> self . assertIsInstance ( zone , <EOL> availability_zones . AvailabilityZone ) <EOL> self . assertEqual ( <NUM_LIT:3> , len ( zones ) ) <EOL> l0 = [ six . u ( '<STR_LIT>' ) , six . u ( '<STR_LIT>' ) ] <EOL> l1 = [ six . u ( '<STR_LIT>' ) , six . u ( '<STR_LIT>' ) ] <EOL> l2 = [ six . u ( '<STR_LIT>' ) , <EOL> six . u ( '<STR_LIT>' ) ] <EOL> l3 = [ six . u ( '<STR_LIT>' ) , six . u ( '<STR_LIT>' ) ] <EOL> l4 = [ six . u ( '<STR_LIT>' ) , six . u ( '<STR_LIT>' ) ] <EOL> l5 = [ six . u ( '<STR_LIT>' ) , <EOL> six . u ( '<STR_LIT>' ) ] <EOL> l6 = [ six . u ( '<STR_LIT>' ) , six . u ( '<STR_LIT>' ) ] <EOL> z0 = shell . _treeizeAvailabilityZone ( zones [ <NUM_LIT:0> ] ) <EOL> z1 = shell . _treeizeAvailabilityZone ( zones [ <NUM_LIT:1> ] ) <EOL> z2 = shell . _treeizeAvailabilityZone ( zones [ <NUM_LIT:2> ] ) <EOL> self . assertEqual ( ( <NUM_LIT:3> , <NUM_LIT:3> , <NUM_LIT:1> ) , ( len ( z0 ) , len ( z1 ) , len ( z2 ) ) ) <EOL> self . _assertZone ( z0 [ <NUM_LIT:0> ] , l0 [ <NUM_LIT:0> ] , l0 [ <NUM_LIT:1> ] ) <EOL> self . _assertZone ( z0 [ <NUM_LIT:1> ] , l1 [ <NUM_LIT:0> ] , l1 [ <NUM_LIT:1> ] ) <EOL> self . _assertZone ( z0 [ <NUM_LIT:2> ] , l2 [ <NUM_LIT:0> ] , l2 [ <NUM_LIT:1> ] ) <EOL> self . _assertZone ( z1 [ <NUM_LIT:0> ] , l3 [ <NUM_LIT:0> ] , l3 [ <NUM_LIT:1> ] ) <EOL> self . _assertZone ( z1 [ <NUM_LIT:1> ] , l4 [ <NUM_LIT:0> ] , l4 [ <NUM_LIT:1> ] ) <EOL> self . _assertZone ( z1 [ <NUM_LIT:2> ] , l5 [ <NUM_LIT:0> ] , l5 [ <NUM_LIT:1> ] ) <EOL> self . _assertZone ( z2 [ <NUM_LIT:0> ] , l6 [ <NUM_LIT:0> ] , l6 [ <NUM_LIT:1> ] ) </s>
