

@mock_redshift
@mock_ec2
def test_delete_cluster_subnet_group():
    vpc_conn = boto.connect_vpc()
    vpc = vpc_conn.create_vpc('10.0.0.0/16')
    subnet = vpc_conn.create_subnet(vpc.id, '10.0.0.0/24')
    redshift_conn = boto.connect_redshift()
    redshift_conn.create_cluster_subnet_group('my_subnet', 'This is my subnet group', subnet_ids=[subnet.id])
    subnets_response = redshift_conn.describe_cluster_subnet_groups()
    subnets = redshift_conn['DescribeClusterSubnetGroupsResponse']['DescribeClusterSubnetGroupsResult']['ClusterSubnetGroups']
    subnets.should.have.length_of(1)
    redshift_conn.delete_cluster_subnet_group('my_subnet')
    subnets_response = redshift_conn.describe_cluster_subnet_groups()
    subnets = subnets_response['DescribeClusterSubnetGroupsResponse']['DescribeClusterSubnetGroupsResult']['ClusterSubnetGroups']
    subnets.should.have.length_of(0)
    redshift_conn.delete_cluster_subnet_group.when.called_with('not-a-subnet-group').should.throw(ClusterSubnetGroupNotFound)

dataset/ETHPy150Open spulec/moto/tests/test_redshift/test_redshift.py test_delete_cluster_subnet_group/VarMisuse@80/152 `subnets_response`->`redshift_conn`