<s> """<STR_LIT>""" <EOL> from testtools import content <EOL> from shade . tests . functional import base <EOL> class TestZone ( base . BaseFunctionalTestCase ) : <EOL> def setUp ( self ) : <EOL> super ( TestZone , self ) . setUp ( ) <EOL> if not self . demo_cloud . has_service ( '<STR_LIT>' ) : <EOL> self . skipTest ( '<STR_LIT>' ) <EOL> def test_zones ( self ) : <EOL> '''<STR_LIT>''' <EOL> name = '<STR_LIT>' <EOL> zone_type = '<STR_LIT>' <EOL> email = '<STR_LIT>' <EOL> description = '<STR_LIT>' <EOL> ttl = <NUM_LIT> <EOL> masters = None <EOL> self . addDetail ( '<STR_LIT>' , content . text_content ( name ) ) <EOL> self . addCleanup ( self . cleanup , name ) <EOL> zone = self . demo_cloud . create_zone ( <EOL> name = name , zone_type = zone_type , email = email , <EOL> description = description , ttl = ttl , <EOL> masters = masters ) <EOL> self . assertEquals ( zone [ '<STR_LIT:name>' ] , name ) <EOL> self . assertEquals ( zone [ '<STR_LIT:type>' ] , zone_type . upper ( ) ) <EOL> self . assertEquals ( zone [ '<STR_LIT:email>' ] , email ) <EOL> self . assertEquals ( zone [ '<STR_LIT:description>' ] , description ) <EOL> self . assertEquals ( zone [ '<STR_LIT>' ] , ttl ) <EOL> self . assertEquals ( zone [ '<STR_LIT>' ] , [ ] ) <EOL> zones = self . demo_cloud . list_zones ( ) <EOL> self . assertIsNotNone ( zones ) <EOL> zone_get = self . demo_cloud . get_zone ( zone [ '<STR_LIT:id>' ] ) <EOL> self . assertEquals ( zone_get [ '<STR_LIT:id>' ] , zone [ '<STR_LIT:id>' ] ) <EOL> zone_get = self . demo_cloud . get_zone ( name ) <EOL> self . assertEquals ( zone_get [ '<STR_LIT:name>' ] , zone [ '<STR_LIT:name>' ] ) <EOL> zone_update = self . demo_cloud . update_zone ( zone [ '<STR_LIT:id>' ] , ttl = <NUM_LIT> ) <EOL> self . assertEquals ( zone_update [ '<STR_LIT:id>' ] , zone [ '<STR_LIT:id>' ] ) <EOL> self . assertEquals ( zone_update [ '<STR_LIT:name>' ] , zone [ '<STR_LIT:name>' ] ) <EOL> self . assertEquals ( zone_update [ '<STR_LIT:type>' ] , zone [ '<STR_LIT:type>' ] ) <EOL> self . assertEquals ( zone_update [ '<STR_LIT:email>' ] , zone [ '<STR_LIT:email>' ] ) <EOL> self . assertEquals ( zone_update [ '<STR_LIT:description>' ] , zone [ '<STR_LIT:description>' ] ) <EOL> self . assertEquals ( zone_update [ '<STR_LIT>' ] , <NUM_LIT> ) <EOL> self . assertEquals ( zone_update [ '<STR_LIT>' ] , zone [ '<STR_LIT>' ] ) <EOL> zone_delete = self . demo_cloud . delete_zone ( zone [ '<STR_LIT:id>' ] ) <EOL> self . assertTrue ( zone_delete ) <EOL> def cleanup ( self , name ) : <EOL> self . demo_cloud . delete_zone ( name ) </s>
