From c3e4b5401c526d9b826ab4404da4f718792bc80c Mon Sep 17 00:00:00 2001 From: Jon Haddad Date: Wed, 30 Oct 2013 17:55:13 -0700 Subject: [PATCH] added new vpc security group test. failing --- tests/test_ec2/test_security_groups.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/test_ec2/test_security_groups.py b/tests/test_ec2/test_security_groups.py index ce8de872b..606faebc3 100644 --- a/tests/test_ec2/test_security_groups.py +++ b/tests/test_ec2/test_security_groups.py @@ -20,6 +20,27 @@ def test_create_and_describe_security_group(): all_groups.should.have.length_of(1) all_groups[0].name.should.equal('test security group') +@mock_ec2 +def test_create_and_describe_vpc_security_group(): + conn = boto.connect_ec2('the_key', 'the_secret') + vpc_id = 'vpc-5300000c' + security_group = conn.create_security_group('test security group', 'this is a test security group', vpc_id) + + security_group.vpc_id.should.equal(vpc_id) + + security_group.name.should.equal('test security group') + security_group.description.should.equal('this is a test security group') + + # Trying to create another group with the same name should throw an error + conn.create_security_group.when.called_with('test security group', 'this is a test security group').should.throw(EC2ResponseError) + + all_groups = conn.get_all_security_groups() + + all_groups[0].vpc_id.should.equal(vpc_id) + + all_groups.should.have.length_of(1) + all_groups[0].name.should.equal('test security group') + @mock_ec2 def test_deleting_security_groups():