

@mock_redshift
def test_create_cluster_with_security_group():
    conn = boto.redshift.connect_to_region('us-east-1')
    conn.create_cluster_security_group('security_group1', 'This is my security group')
    conn.create_cluster_security_group('security_group2', 'This is my security group')
    cluster_identifier = 'my_cluster'
    conn.create_cluster(cluster_identifier, node_type='dw.hs1.xlarge', master_username='username', master_user_password='password', cluster_security_groups=['security_group1', 'security_group2'])
    cluster_response = conn.describe_clusters(cluster_identifier)
    cluster = cluster_response['DescribeClustersResponse']['DescribeClustersResult']['Clusters'][0]
    group_names = [group['ClusterSecurityGroupName'] for group in cluster['ClusterSecurityGroups']]
    set(group_names).should.equal(set(['security_group1', 'security_group2']))

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