mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Set up tests (and make them pass) for orderable_db_instance_options
This commit is contained in:
parent
4f2052b822
commit
48327e462f
3 changed files with 61 additions and 0 deletions
14
tests/aws/models/rds/instance_option_tests.rb
Normal file
14
tests/aws/models/rds/instance_option_tests.rb
Normal file
|
@ -0,0 +1,14 @@
|
|||
Shindo.tests("AWS::RDS | db instance options", ['aws', 'rds']) do
|
||||
|
||||
params = {:engine => 'mysql'}
|
||||
|
||||
pending if Fog.mocking?
|
||||
|
||||
tests('#options') do
|
||||
tests 'contains options' do
|
||||
@instance = Fog::AWS[:rds].instance_options.new(params)
|
||||
returns(true) { @instance.engine == 'mysql' }
|
||||
end
|
||||
end
|
||||
|
||||
end
|
|
@ -8,6 +8,11 @@ class AWS
|
|||
'ResponseMetadata' => {'RequestId' => String}
|
||||
}
|
||||
|
||||
DB_AVAILABILITY_ZONE_OPTION = {
|
||||
'Name' => String,
|
||||
'ProvisionedIopsCapable' => Fog::Boolean
|
||||
}
|
||||
|
||||
DB_PARAMETER_GROUP = {
|
||||
'DBParameterGroupFamily' => String,
|
||||
'DBParameterGroupName'=> String,
|
||||
|
@ -79,6 +84,23 @@ class AWS
|
|||
}
|
||||
}
|
||||
|
||||
ORDERABLE_DB_INSTANCE_OPTION = {
|
||||
'MultiAZCapable' => Fog::Boolean,
|
||||
'Engine' => String,
|
||||
'LicenseModel' => String,
|
||||
'ReadReplicaCapable' => Fog::Boolean,
|
||||
'EngineVersion' => String,
|
||||
'AvailabilityZones' => [DB_AVAILABILITY_ZONE_OPTION],
|
||||
'DBInstanceClass' => String,
|
||||
'Vpc' => Fog::Boolean
|
||||
}
|
||||
|
||||
DESCRIBE_ORDERABLE_DB_INSTANCE_OPTION = BASIC.merge({
|
||||
'DescribeOrderableDBInstanceOptionsResult' =>{
|
||||
'OrderableDBInstanceOptions' => [ORDERABLE_DB_INSTANCE_OPTION]
|
||||
}
|
||||
})
|
||||
|
||||
MODIFY_PARAMETER_GROUP = BASIC.merge({
|
||||
'ModifyDBParameterGroupResult' => {
|
||||
'DBParameterGroupName' => String
|
||||
|
|
25
tests/aws/requests/rds/instance_option_tests.rb
Normal file
25
tests/aws/requests/rds/instance_option_tests.rb
Normal file
|
@ -0,0 +1,25 @@
|
|||
Shindo.tests('AWS::RDS | db instance option requests', ['aws', 'rds']) do
|
||||
tests('success') do
|
||||
|
||||
tests("#describe_orderable_db_instance_options('mysql)").formats(AWS::RDS::Formats::DESCRIBE_ORDERABLE_DB_INSTANCE_OPTION) do
|
||||
|
||||
body = Fog::AWS[:rds].describe_orderable_db_instance_options('mysql').body
|
||||
|
||||
returns(100) {body['DescribeOrderableDBInstanceOptionsResult']['OrderableDBInstanceOptions'].length}
|
||||
|
||||
group = body['DescribeOrderableDBInstanceOptionsResult']['OrderableDBInstanceOptions'].first
|
||||
returns( true ) { group['MultiAZCapable'] }
|
||||
returns( 'mysql' ) { group['Engine'] }
|
||||
returns( true ) { group['ReadReplicaCapable'] }
|
||||
returns( true ) { group['AvailabilityZones'].length >= 1 }
|
||||
|
||||
body
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
tests("failures") do
|
||||
raises(Fog::AWS::RDS::Error) {Fog::AWS[:rds].describe_orderable_db_instance_options('doesntexist')}
|
||||
end
|
||||
|
||||
end
|
Loading…
Reference in a new issue