From 8781714f5cadeab86f96327906e1e8b68b97d78e Mon Sep 17 00:00:00 2001 From: Jon Haddad Date: Thu, 5 Dec 2013 17:00:35 -0800 Subject: [PATCH] security group deletion --- tests/test_ec2/test_security_groups.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/test_ec2/test_security_groups.py b/tests/test_ec2/test_security_groups.py index 6b33c3604..07af33152 100644 --- a/tests/test_ec2/test_security_groups.py +++ b/tests/test_ec2/test_security_groups.py @@ -76,6 +76,21 @@ def test_deleting_security_groups(): conn.delete_security_group(security_group1.id) conn.get_all_security_groups().should.have.length_of(0) +@mock_ec2 +def test_delete_security_group_in_vpc(): + conn = boto.connect_ec2('the_key', 'the_secret') + vpc_id = "vpc-12345" + security_group1 = conn.create_security_group('test1', 'test1', vpc_id) + + # Deleting a group that doesn't exist in the VPC should throw an error + conn.delete_security_group.when.called_with('test1').should.throw(EC2ResponseError) + + conn.delete_security_group("test1", vpc_id=vpc_id) + + # Delete by group id + # conn.delete_security_group(security_group1.id) + # conn.get_all_security_groups().should.have.length_of(0) + @mock_ec2 def test_authorize_ip_range_and_revoke():