@mock_ec2
def test_igw_filter_by_vpc_id():
 conn = boto.connect_vpc(u'the_key', u'the_secret')
 igw1 = conn.create_internet_gateway()
 igw2 = conn.create_internet_gateway()
 vpc = conn.create_vpc(VPC_CIDR)
 conn.attach_internet_gateway(igw1.id, vpc.id)
 result = conn.get_all_internet_gateways(filters={u'attachment.vpc-id': vpc.id})
 result.should.have.length_of(1)
 result[0].id.should.equal(igw1.id)

@ mock_ec2 def test_igw_filter_by_vpc_id ( ) : conn = boto . connect_vpc ( u'the_key' , u'the_secret' ) igw1 = conn . create_internet_gateway ( ) igw2 = conn . create_internet_gateway ( ) vpc = conn . create_vpc ( VPC_CIDR ) conn . attach_internet_gateway ( igw1 . id , vpc . id ) result = conn . get_all_internet_gateways ( filters = { u'attachment.vpc-id' : vpc . id } ) result . should . have . length_of ( 1 ) result [ 0 ] . id . should . equal ( igw1 . id )
internet gateway filter by vpc id .