@mock_ec2
def test_igw_delete():
 conn = boto.connect_vpc(u'the_key', u'the_secret')
 vpc = conn.create_vpc(VPC_CIDR)
 conn.get_all_internet_gateways().should.have.length_of(0)
 igw = conn.create_internet_gateway()
 conn.get_all_internet_gateways().should.have.length_of(1)
 with assert_raises(JSONResponseError) as ex:
  conn.delete_internet_gateway(igw.id, dry_run=True)
 ex.exception.reason.should.equal(u'DryRunOperation')
 ex.exception.status.should.equal(400)
 ex.exception.message.should.equal(u'An error occurred (DryRunOperation) when calling the DeleteInternetGateway operation: Request would have succeeded, but DryRun flag is set')
 conn.delete_internet_gateway(igw.id)
 conn.get_all_internet_gateways().should.have.length_of(0)

@ mock_ec2 def test_igw_delete ( ) : conn = boto . connect_vpc ( u'the_key' , u'the_secret' ) vpc = conn . create_vpc ( VPC_CIDR ) conn . get_all_internet_gateways ( ) . should . have . length_of ( 0 ) igw = conn . create_internet_gateway ( ) conn . get_all_internet_gateways ( ) . should . have . length_of ( 1 ) with assert_raises ( JSONResponseError ) as ex : conn . delete_internet_gateway ( igw . id , dry_run = True ) ex . exception . reason . should . equal ( u'DryRunOperation' ) ex . exception . status . should . equal ( 400 ) ex . exception . message . should . equal ( u'An error occurred (DryRunOperation) when calling the DeleteInternetGateway operation: Request would have succeeded, but DryRun flag is set' ) conn . delete_internet_gateway ( igw . id ) conn . get_all_internet_gateways ( ) . should . have . length_of ( 0 )
internet gateway delete .