#NEWLINE# def test_describe_internet_gateways_filters( self ) : #NEWLINE# #INDENT# data = self . client . describe_internet_gateways ( Filters = [ { #NEWLINE# #INDENT# 'Name' : 'attachment.vpc-id' , #NEWLINE# 'Values' : [ self . vpc_id ] , #NEWLINE# #UNINDENT# } ] ) #NEWLINE# self . assertEqual ( 0 , len ( data [ 'InternetGateways' ] ) ) #NEWLINE# data = self . client . create_internet_gateway ( ) #NEWLINE# gw_id = data [ 'InternetGateway' ] [ 'InternetGatewayId' ] #NEWLINE# res_clean = self . addResourceCleanUp ( self . client . delete_internet_gateway , InternetGatewayId = gw_id ) #NEWLINE# self . assertEmpty ( data [ 'InternetGateway' ] . get ( 'Attachments' , [ ] ) ) #NEWLINE# data = self . client . attach_internet_gateway ( VpcId = self . vpc_id , InternetGatewayId = gw_id ) #NEWLINE# self . addResourceCleanUp ( self . client . detach_internet_gateway , VpcId = self . vpc_id , InternetGatewayId = gw_id ) #NEWLINE# time . sleep ( 2 ) #NEWLINE# data = self . client . describe_internet_gateways ( Filters = [ { #NEWLINE# #INDENT# 'Name' : 'attachment.vpc-id' , #NEWLINE# 'Values' : [ self . vpc_id ] , #NEWLINE# #UNINDENT# } ] ) #NEWLINE# self . assertEqual ( 1 , len ( data [ 'InternetGateways' ] ) ) #NEWLINE# self . assertEqual ( self , data [ 'InternetGateways' ] [ 0 ] [ 'InternetGatewayId' ] ) #NEWLINE# data = self . client . describe_internet_gateways ( Filters = [ { #NEWLINE# #INDENT# 'Name' : 'attachment.vpc-id' , #NEWLINE# 'Values' : [ 'vpc-0' ] , #NEWLINE# #UNINDENT# } ] ) #NEWLINE# self . assertEqual ( 0 , len ( data [ 'InternetGateways' ] ) ) #NEWLINE# self . assertRaises ( 'InvalidParameterValue' , self . client . describe_internet_gateways , Filters = [ { #NEWLINE# #INDENT# 'Name' : 'fake' , #NEWLINE# 'Values' : [ 'fake' ] , #NEWLINE# #UNINDENT# } ] ) #NEWLINE# data = self . client . detach_internet_gateway ( VpcId = self . vpc_id , InternetGatewayId = gw_id ) #NEWLINE# data = self . client . delete_internet_gateway ( InternetGatewayId = gw_id ) #NEWLINE# self . cancelResourceCleanUp ( res_clean )