add subnets

This commit is contained in:
Steve Pulec 2013-03-05 22:53:53 -05:00
commit 316418df55
4 changed files with 107 additions and 6 deletions

View file

@ -1,4 +1,5 @@
import boto
from boto.exception import EC2ResponseError
import sure # flake8: noqa
from moto import mock_ec2
@ -6,4 +7,17 @@ from moto import mock_ec2
@mock_ec2
def test_subnets():
pass
conn = boto.connect_vpc('the_key', 'the_secret')
vpc = conn.create_vpc("10.0.0.0/16")
subnet = conn.create_subnet(vpc.id, "10.0.0.0/18")
all_subnets = conn.get_all_subnets()
all_subnets.should.have.length_of(1)
conn.delete_subnet(subnet.id)
all_subnets = conn.get_all_subnets()
all_subnets.should.have.length_of(0)
conn.delete_subnet.when.called_with(
subnet.id).should.throw(EC2ResponseError)