@mock_ec2
def test_igw_create():
 conn = boto.connect_vpc(u'the_key', u'the_secret')
 conn.get_all_internet_gateways().should.have.length_of(0)
 with assert_raises(JSONResponseError) as ex:
  igw = conn.create_internet_gateway(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 CreateInternetGateway operation: Request would have succeeded, but DryRun flag is set')
 igw = conn.create_internet_gateway()
 conn.get_all_internet_gateways().should.have.length_of(1)
 igw.id.should.match(u'igw-[0-9a-f]+')
 igw = conn.get_all_internet_gateways()[0]
 igw.attachments.should.have.length_of(0)

@ mock_ec2 def test_igw_create ( ) : conn = boto . connect_vpc ( u'the_key' , u'the_secret' ) conn . get_all_internet_gateways ( ) . should . have . length_of ( 0 ) with assert_raises ( JSONResponseError ) as ex : igw = conn . create_internet_gateway ( 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 CreateInternetGateway operation: Request would have succeeded, but DryRun flag is set' ) igw = conn . create_internet_gateway ( ) conn . get_all_internet_gateways ( ) . should . have . length_of ( 1 ) igw . id . should . match ( u'igw-[0-9a-f]+' ) igw = conn . get_all_internet_gateways ( ) [ 0 ] igw . attachments . should . have . length_of ( 0 )
internet gateway create .