

@mock_redshift
@mock_ec2
def test_create_cluster_subnet_group():
    vpc_conn = boto.connect_vpc()
    vpc = vpc_conn.create_vpc('10.0.0.0/16')
    subnet1 = vpc_conn.create_subnet(vpc.id, '10.0.0.0/24')
    subnet2 = vpc_conn.create_subnet(redshift_conn.id, '10.0.1.0/24')
    redshift_conn = boto.connect_redshift()
    redshift_conn.create_cluster_subnet_group('my_subnet', 'This is my subnet group', subnet_ids=[subnet1.id, subnet2.id])
    subnets_response = redshift_conn.describe_cluster_subnet_groups('my_subnet')
    my_subnet = subnets_response['DescribeClusterSubnetGroupsResponse']['DescribeClusterSubnetGroupsResult']['ClusterSubnetGroups'][0]
    my_subnet['ClusterSubnetGroupName'].should.equal('my_subnet')
    my_subnet['Description'].should.equal('This is my subnet group')
    subnet_ids = [subnet['SubnetIdentifier'] for subnet in my_subnet['Subnets']]
    set(subnet_ids).should.equal(set([subnet1.id, subnet2.id]))

dataset/ETHPy150Open spulec/moto/tests/test_redshift/test_redshift.py test_create_cluster_subnet_group/VarMisuse@51/97 `vpc`->`redshift_conn`