From 50b80b68f01a0452e999b82e45d14536ce07a69f Mon Sep 17 00:00:00 2001 From: Steve Pulec Date: Sun, 23 Nov 2014 23:20:02 -0500 Subject: [PATCH] Add invalid subnet test. --- tests/test_redshift/test_redshift.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/test_redshift/test_redshift.py b/tests/test_redshift/test_redshift.py index bb4b2ce10..700301418 100644 --- a/tests/test_redshift/test_redshift.py +++ b/tests/test_redshift/test_redshift.py @@ -6,6 +6,7 @@ from boto.redshift.exceptions import ( ClusterParameterGroupNotFound, ClusterSecurityGroupNotFound, ClusterSubnetGroupNotFound, + InvalidSubnet, ) import sure # noqa @@ -305,6 +306,17 @@ def test_create_cluster_subnet_group(): set(subnet_ids).should.equal(set([subnet1.id, subnet2.id])) +@mock_redshift +@mock_ec2 +def test_create_invalid_cluster_subnet_group(): + redshift_conn = boto.connect_redshift() + redshift_conn.create_cluster_subnet_group.when.called_with( + "my_subnet", + "This is my subnet group", + subnet_ids=["subnet-1234"], + ).should.throw(InvalidSubnet) + + @mock_redshift def test_describe_non_existant_subnet_group(): conn = boto.redshift.connect_to_region("us-east-1")