<s> import botocore . exceptions <EOL> from ec2api . tests . functional import base <EOL> from ec2api . tests . functional import config <EOL> CONF = config . CONF <EOL> class CustomerGatewayTest ( base . EC2TestCase ) : <EOL> CUSTOMER_GATEWAY_IP = '<STR_LIT>' <EOL> @ classmethod <EOL> @ base . safe_setup <EOL> def setUpClass ( cls ) : <EOL> super ( CustomerGatewayTest , cls ) . setUpClass ( ) <EOL> if not base . TesterStateHolder ( ) . get_vpc_enabled ( ) : <EOL> raise cls . skipException ( '<STR_LIT>' ) <EOL> def test_create_delete_customer_gateway ( self ) : <EOL> data = self . client . create_customer_gateway ( <EOL> Type = '<STR_LIT>' , PublicIp = self . CUSTOMER_GATEWAY_IP , BgpAsn = <NUM_LIT> ) <EOL> cgw_id = data [ '<STR_LIT>' ] [ '<STR_LIT>' ] <EOL> cgw_clean = self . addResourceCleanUp ( <EOL> self . client . delete_customer_gateway , CustomerGatewayId = cgw_id ) <EOL> self . assertEqual ( self . CUSTOMER_GATEWAY_IP , <EOL> data [ '<STR_LIT>' ] [ '<STR_LIT>' ] ) <EOL> self . client . delete_customer_gateway ( CustomerGatewayId = cgw_id ) <EOL> self . cancelResourceCleanUp ( cgw_clean ) <EOL> try : <EOL> data = self . client . describe_customer_gateways ( <EOL> CustomerGatewayIds = [ cgw_id ] ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( data [ '<STR_LIT>' ] ) ) <EOL> self . assertEqual ( '<STR_LIT>' , data [ '<STR_LIT>' ] [ <NUM_LIT:0> ] [ '<STR_LIT>' ] ) <EOL> except botocore . exceptions . ClientError as ex : <EOL> self . assertEqual ( '<STR_LIT>' , <EOL> ex . response [ '<STR_LIT>' ] [ '<STR_LIT>' ] ) </s>
