Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
0527e88d46
541 changed files with 75504 additions and 51429 deletions
|
|
@ -7,54 +7,51 @@ from moto import mock_ec2_deprecated
|
|||
|
||||
@mock_ec2_deprecated
|
||||
def test_virtual_private_gateways():
|
||||
conn = boto.connect_vpc('the_key', 'the_secret')
|
||||
conn = boto.connect_vpc("the_key", "the_secret")
|
||||
|
||||
vpn_gateway = conn.create_vpn_gateway('ipsec.1', 'us-east-1a')
|
||||
vpn_gateway = conn.create_vpn_gateway("ipsec.1", "us-east-1a")
|
||||
vpn_gateway.should_not.be.none
|
||||
vpn_gateway.id.should.match(r'vgw-\w+')
|
||||
vpn_gateway.type.should.equal('ipsec.1')
|
||||
vpn_gateway.state.should.equal('available')
|
||||
vpn_gateway.availability_zone.should.equal('us-east-1a')
|
||||
vpn_gateway.id.should.match(r"vgw-\w+")
|
||||
vpn_gateway.type.should.equal("ipsec.1")
|
||||
vpn_gateway.state.should.equal("available")
|
||||
vpn_gateway.availability_zone.should.equal("us-east-1a")
|
||||
|
||||
|
||||
@mock_ec2_deprecated
|
||||
def test_describe_vpn_gateway():
|
||||
conn = boto.connect_vpc('the_key', 'the_secret')
|
||||
vpn_gateway = conn.create_vpn_gateway('ipsec.1', 'us-east-1a')
|
||||
conn = boto.connect_vpc("the_key", "the_secret")
|
||||
vpn_gateway = conn.create_vpn_gateway("ipsec.1", "us-east-1a")
|
||||
|
||||
vgws = conn.get_all_vpn_gateways()
|
||||
vgws.should.have.length_of(1)
|
||||
|
||||
gateway = vgws[0]
|
||||
gateway.id.should.match(r'vgw-\w+')
|
||||
gateway.id.should.match(r"vgw-\w+")
|
||||
gateway.id.should.equal(vpn_gateway.id)
|
||||
vpn_gateway.type.should.equal('ipsec.1')
|
||||
vpn_gateway.state.should.equal('available')
|
||||
vpn_gateway.availability_zone.should.equal('us-east-1a')
|
||||
vpn_gateway.type.should.equal("ipsec.1")
|
||||
vpn_gateway.state.should.equal("available")
|
||||
vpn_gateway.availability_zone.should.equal("us-east-1a")
|
||||
|
||||
|
||||
@mock_ec2_deprecated
|
||||
def test_vpn_gateway_vpc_attachment():
|
||||
conn = boto.connect_vpc('the_key', 'the_secret')
|
||||
conn = boto.connect_vpc("the_key", "the_secret")
|
||||
vpc = conn.create_vpc("10.0.0.0/16")
|
||||
vpn_gateway = conn.create_vpn_gateway('ipsec.1', 'us-east-1a')
|
||||
vpn_gateway = conn.create_vpn_gateway("ipsec.1", "us-east-1a")
|
||||
|
||||
conn.attach_vpn_gateway(
|
||||
vpn_gateway_id=vpn_gateway.id,
|
||||
vpc_id=vpc.id
|
||||
)
|
||||
conn.attach_vpn_gateway(vpn_gateway_id=vpn_gateway.id, vpc_id=vpc.id)
|
||||
|
||||
gateway = conn.get_all_vpn_gateways()[0]
|
||||
attachments = gateway.attachments
|
||||
attachments.should.have.length_of(1)
|
||||
attachments[0].vpc_id.should.equal(vpc.id)
|
||||
attachments[0].state.should.equal('attached')
|
||||
attachments[0].state.should.equal("attached")
|
||||
|
||||
|
||||
@mock_ec2_deprecated
|
||||
def test_delete_vpn_gateway():
|
||||
conn = boto.connect_vpc('the_key', 'the_secret')
|
||||
vpn_gateway = conn.create_vpn_gateway('ipsec.1', 'us-east-1a')
|
||||
conn = boto.connect_vpc("the_key", "the_secret")
|
||||
vpn_gateway = conn.create_vpn_gateway("ipsec.1", "us-east-1a")
|
||||
|
||||
conn.delete_vpn_gateway(vpn_gateway.id)
|
||||
vgws = conn.get_all_vpn_gateways()
|
||||
|
|
@ -63,8 +60,8 @@ def test_delete_vpn_gateway():
|
|||
|
||||
@mock_ec2_deprecated
|
||||
def test_vpn_gateway_tagging():
|
||||
conn = boto.connect_vpc('the_key', 'the_secret')
|
||||
vpn_gateway = conn.create_vpn_gateway('ipsec.1', 'us-east-1a')
|
||||
conn = boto.connect_vpc("the_key", "the_secret")
|
||||
vpn_gateway = conn.create_vpn_gateway("ipsec.1", "us-east-1a")
|
||||
vpn_gateway.add_tag("a key", "some value")
|
||||
|
||||
tag = conn.get_all_tags()[0]
|
||||
|
|
@ -80,25 +77,19 @@ def test_vpn_gateway_tagging():
|
|||
@mock_ec2_deprecated
|
||||
def test_detach_vpn_gateway():
|
||||
|
||||
conn = boto.connect_vpc('the_key', 'the_secret')
|
||||
conn = boto.connect_vpc("the_key", "the_secret")
|
||||
vpc = conn.create_vpc("10.0.0.0/16")
|
||||
vpn_gateway = conn.create_vpn_gateway('ipsec.1', 'us-east-1a')
|
||||
vpn_gateway = conn.create_vpn_gateway("ipsec.1", "us-east-1a")
|
||||
|
||||
conn.attach_vpn_gateway(
|
||||
vpn_gateway_id=vpn_gateway.id,
|
||||
vpc_id=vpc.id
|
||||
)
|
||||
conn.attach_vpn_gateway(vpn_gateway_id=vpn_gateway.id, vpc_id=vpc.id)
|
||||
|
||||
gateway = conn.get_all_vpn_gateways()[0]
|
||||
attachments = gateway.attachments
|
||||
attachments.should.have.length_of(1)
|
||||
attachments[0].vpc_id.should.equal(vpc.id)
|
||||
attachments[0].state.should.equal('attached')
|
||||
attachments[0].state.should.equal("attached")
|
||||
|
||||
conn.detach_vpn_gateway(
|
||||
vpn_gateway_id=vpn_gateway.id,
|
||||
vpc_id=vpc.id
|
||||
)
|
||||
conn.detach_vpn_gateway(vpn_gateway_id=vpn_gateway.id, vpc_id=vpc.id)
|
||||
|
||||
gateway = conn.get_all_vpn_gateways()[0]
|
||||
attachments = gateway.attachments
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue