<s> from tests . unit import unittest <EOL> from tests . unit import AWSMockServiceTestCase <EOL> from boto . vpc import VPCConnection , VpnConnection <EOL> DESCRIBE_VPNCONNECTIONS = b'''<STR_LIT>''' <EOL> class TestDescribeVPNConnections ( AWSMockServiceTestCase ) : <EOL> connection_class = VPCConnection <EOL> def default_body ( self ) : <EOL> return DESCRIBE_VPNCONNECTIONS <EOL> def test_get_vpcs ( self ) : <EOL> self . set_http_response ( status_code = <NUM_LIT:200> ) <EOL> api_response = self . service_connection . get_all_vpn_connections ( <EOL> [ '<STR_LIT>' , '<STR_LIT>' ] , filters = [ ( '<STR_LIT:state>' , [ '<STR_LIT>' , '<STR_LIT>' ] ) ] ) <EOL> self . assert_request_parameters ( { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:state>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' } , <EOL> ignore_params_values = [ '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' ] ) <EOL> self . assertEqual ( len ( api_response ) , <NUM_LIT:2> ) <EOL> vpn0 = api_response [ <NUM_LIT:0> ] <EOL> self . assertEqual ( vpn0 . type , '<STR_LIT>' ) <EOL> self . assertEqual ( vpn0 . customer_gateway_id , '<STR_LIT>' ) <EOL> self . assertEqual ( vpn0 . vpn_gateway_id , '<STR_LIT>' ) <EOL> self . assertEqual ( len ( vpn0 . tunnels ) , <NUM_LIT:2> ) <EOL> self . assertDictEqual ( vpn0 . tags , { '<STR_LIT:Name>' : '<STR_LIT>' } ) <EOL> vpn1 = api_response [ <NUM_LIT:1> ] <EOL> self . assertEqual ( vpn1 . state , '<STR_LIT>' ) <EOL> self . assertEqual ( len ( vpn1 . static_routes ) , <NUM_LIT:1> ) <EOL> self . assertTrue ( vpn1 . options . static_routes_only ) <EOL> self . assertEqual ( vpn1 . tunnels [ <NUM_LIT:0> ] . status , '<STR_LIT>' ) <EOL> self . assertEqual ( vpn1 . tunnels [ <NUM_LIT:1> ] . status , '<STR_LIT>' ) <EOL> self . assertDictEqual ( vpn1 . tags , { } ) <EOL> self . assertEqual ( vpn1 . static_routes [ <NUM_LIT:0> ] . source , '<STR_LIT>' ) <EOL> self . assertEqual ( vpn1 . static_routes [ <NUM_LIT:0> ] . state , '<STR_LIT>' ) <EOL> class TestCreateVPNConnection ( AWSMockServiceTestCase ) : <EOL> connection_class = VPCConnection <EOL> def default_body ( self ) : <EOL> return b"""<STR_LIT>""" <EOL> def test_create_vpn_connection ( self ) : <EOL> self . set_http_response ( status_code = <NUM_LIT:200> ) <EOL> api_response = self . service_connection . create_vpn_connection ( <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , static_routes_only = True ) <EOL> self . assert_request_parameters ( { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:true>' } , <EOL> ignore_params_values = [ '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' ] ) <EOL> self . assertIsInstance ( api_response , VpnConnection ) <EOL> self . assertEquals ( api_response . id , '<STR_LIT>' ) <EOL> self . assertEquals ( api_response . customer_gateway_id , '<STR_LIT>' ) <EOL> self . assertEquals ( api_response . options . static_routes_only , True ) <EOL> class TestDeleteVPNConnection ( AWSMockServiceTestCase ) : <EOL> connection_class = VPCConnection <EOL> def default_body ( self ) : <EOL> return b"""<STR_LIT>""" <EOL> def test_delete_vpn_connection ( self ) : <EOL> self . set_http_response ( status_code = <NUM_LIT:200> ) <EOL> api_response = self . service_connection . delete_vpn_connection ( '<STR_LIT>' ) <EOL> self . assert_request_parameters ( { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' } , <EOL> ignore_params_values = [ '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' ] ) <EOL> self . assertEquals ( api_response , True ) <EOL> class TestCreateVPNConnectionRoute ( AWSMockServiceTestCase ) : <EOL> connection_class = VPCConnection <EOL> def default_body ( self ) : <EOL> return b"""<STR_LIT>""" <EOL> def test_create_vpn_connection_route ( self ) : <EOL> self . set_http_response ( status_code = <NUM_LIT:200> ) <EOL> api_response = self . service_connection . create_vpn_connection_route ( <EOL> '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assert_request_parameters ( { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' } , <EOL> ignore_params_values = [ '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' ] ) <EOL> self . assertEquals ( api_response , True ) <EOL> class TestDeleteVPNConnectionRoute ( AWSMockServiceTestCase ) : <EOL> connection_class = VPCConnection <EOL> def default_body ( self ) : <EOL> return b"""<STR_LIT>""" <EOL> def test_delete_vpn_connection_route ( self ) : <EOL> self . set_http_response ( status_code = <NUM_LIT:200> ) <EOL> api_response = self . service_connection . delete_vpn_connection_route ( <EOL> '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assert_request_parameters ( { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' } , <EOL> ignore_params_values = [ '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' ] ) <EOL> self . assertEquals ( api_response , True ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
