

@mock_redshift
def test_modify_cluster():
    conn = boto.connect_redshift()
    cluster_identifier = 'my_cluster'
    conn.create_cluster_security_group('security_group', 'This is my security group')
    conn.create_cluster_parameter_group('my_parameter_group', 'redshift-1.0', 'This is my parameter group')
    cluster.create_cluster(cluster_identifier, node_type='single-node', master_username='username', master_user_password='password')
    conn.modify_cluster(cluster_identifier, cluster_type='multi-node', node_type='dw.hs1.xlarge', number_of_nodes=2, cluster_security_groups='security_group', master_user_password='new_password', cluster_parameter_group_name='my_parameter_group', automated_snapshot_retention_period=7, preferred_maintenance_window='Tue:03:00-Tue:11:00', allow_version_upgrade=False, new_cluster_identifier='new_identifier')
    cluster_response = conn.describe_clusters('new_identifier')
    cluster = cluster_response['DescribeClustersResponse']['DescribeClustersResult']['Clusters'][0]
    cluster['ClusterIdentifier'].should.equal('new_identifier')
    cluster['NodeType'].should.equal('dw.hs1.xlarge')
    cluster['ClusterSecurityGroups'][0]['ClusterSecurityGroupName'].should.equal('security_group')
    cluster['PreferredMaintenanceWindow'].should.equal('Tue:03:00-Tue:11:00')
    cluster['ClusterParameterGroups'][0]['ParameterGroupName'].should.equal('my_parameter_group')
    cluster['AutomatedSnapshotRetentionPeriod'].should.equal(7)
    cluster['AllowVersionUpgrade'].should.equal(False)
    cluster['NumberOfNodes'].should.equal(2)

dataset/ETHPy150Open spulec/moto/tests/test_redshift/test_redshift.py test_modify_cluster/VarMisuse@44/100 `conn`->`cluster`