Add support for OptionGroupName in create_db_instance
This commit is contained in:
parent
108dc6b049
commit
4fd0b5c710
4 changed files with 62 additions and 13 deletions
|
|
@ -37,6 +37,38 @@ def test_create_database():
|
|||
db_instance['InstanceCreateTime'].should.be.a("datetime.datetime")
|
||||
|
||||
|
||||
@mock_rds2
|
||||
def test_create_database_non_existing_option_group():
|
||||
conn = boto3.client('rds', region_name='us-west-2')
|
||||
database = conn.create_db_instance.when.called_with(
|
||||
DBInstanceIdentifier='db-master-1',
|
||||
AllocatedStorage=10,
|
||||
Engine='postgres',
|
||||
DBName='staging-postgres',
|
||||
DBInstanceClass='db.m1.small',
|
||||
OptionGroupName='non-existing').should.throw(ClientError)
|
||||
|
||||
|
||||
@mock_rds2
|
||||
def test_create_database_with_option_group():
|
||||
conn = boto3.client('rds', region_name='us-west-2')
|
||||
conn.create_option_group(OptionGroupName='my-og',
|
||||
EngineName='mysql',
|
||||
MajorEngineVersion='5.6',
|
||||
OptionGroupDescription='test option group')
|
||||
database = conn.create_db_instance(DBInstanceIdentifier='db-master-1',
|
||||
AllocatedStorage=10,
|
||||
Engine='postgres',
|
||||
DBName='staging-postgres',
|
||||
DBInstanceClass='db.m1.small',
|
||||
OptionGroupName='my-og')
|
||||
db_instance = database['DBInstance']
|
||||
db_instance['AllocatedStorage'].should.equal(10)
|
||||
db_instance['DBInstanceClass'].should.equal('db.m1.small')
|
||||
db_instance['DBName'].should.equal('staging-postgres')
|
||||
db_instance['OptionGroupMemberships'][0]['OptionGroupName'].should.equal('my-og')
|
||||
|
||||
|
||||
@mock_rds2
|
||||
def test_stop_database():
|
||||
conn = boto3.client('rds', region_name='us-west-2')
|
||||
|
|
@ -205,6 +237,7 @@ def test_get_databases_paginated():
|
|||
resp3 = conn.describe_db_instances(MaxRecords=100)
|
||||
resp3["DBInstances"].should.have.length_of(51)
|
||||
|
||||
|
||||
@mock_rds2
|
||||
def test_describe_non_existant_database():
|
||||
conn = boto3.client('rds', region_name='us-west-2')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue