

@mock_redshift
@mock_ec2
def test_create_cluster_with_vpc_security_groups():
    vpc_conn = boto.connect_vpc()
    ec2_conn = boto.connect_ec2()
    redshift_conn = boto.connect_redshift()
    vpc = vpc_conn.create_vpc('10.0.0.0/16')
    security_group = ec2_conn.create_security_group('vpc_security_group', 'a group', vpc_id=vpc.id)
    redshift_conn.create_cluster('my_cluster', node_type='dw.hs1.xlarge', master_username='username', master_user_password='password', vpc_security_group_ids=[security_group.id])
    cluster_response = redshift_conn.describe_clusters('my_cluster')
    cluster = cluster_response['DescribeClustersResponse']['DescribeClustersResult']['Clusters'][0]
    group_ids = [group['VpcSecurityGroupId'] for group in cluster['VpcSecurityGroups']]
    list(group_ids).should.equal([security_group.id])

dataset/ETHPy150Open spulec/moto/tests/test_redshift/test_redshift.py test_create_cluster_with_vpc_security_groups/original