@mock_ec2
def test_igw_attach_bad_vpc():
 conn = boto.connect_vpc(u'the_key', u'the_secret')
 igw = conn.create_internet_gateway()
 with assert_raises(EC2ResponseError) as cm:
  conn.attach_internet_gateway(igw.id, BAD_VPC)
 cm.exception.code.should.equal(u'InvalidVpcID.NotFound')
 cm.exception.status.should.equal(400)
 cm.exception.request_id.should_not.be.none

@ mock_ec2 def test_igw_attach_bad_vpc ( ) : conn = boto . connect_vpc ( u'the_key' , u'the_secret' ) igw = conn . create_internet_gateway ( ) with assert_raises ( EC2ResponseError ) as cm : conn . attach_internet_gateway ( igw . id , BAD_VPC ) cm . exception . code . should . equal ( u'InvalidVpcID.NotFound' ) cm . exception . status . should . equal ( 400 ) cm . exception . request_id . should_not . be . none
internet gateway fail to attach w/ bad vpc .