mirror of
https://github.com/fog/fog-aws.git
synced 2022-11-09 13:50:52 -05:00
mock DescribeDBEngineVersions
This commit is contained in:
parent
8f537d2840
commit
d5fd93cc5c
4 changed files with 45 additions and 1 deletions
|
@ -101,6 +101,22 @@ module Fog
|
|||
:subnet_groups => {},
|
||||
:snapshots => {},
|
||||
:event_subscriptions => {},
|
||||
:db_engine_versions => [
|
||||
{
|
||||
'Engine' => "mysql",
|
||||
'DBParameterGroupFamily' => "mysql5.1",
|
||||
'DBEngineDescription' => "MySQL Community Edition",
|
||||
'EngineVersion' => "5.1.57",
|
||||
'DBEngineVersionDescription' => "MySQL 5.1.57"
|
||||
},
|
||||
{
|
||||
'Engine' => "postgres",
|
||||
'DBParameterGroupFamily' => "postgres9.3",
|
||||
'DBEngineDescription' => "PostgreSQL",
|
||||
'EngineVersion' => "9.3.5",
|
||||
'DBEngineVersionDescription' => "PostgreSQL 9.3.5"
|
||||
},
|
||||
],
|
||||
:parameter_groups => {
|
||||
"default.mysql5.1" => {
|
||||
"DBParameterGroupFamily" => "mysql5.1",
|
||||
|
|
|
@ -22,7 +22,14 @@ module Fog
|
|||
|
||||
class Mock
|
||||
def describe_db_engine_versions(opts={})
|
||||
Fog::Mock.not_implemented
|
||||
response = Excon::Response.new
|
||||
|
||||
response.status = 200
|
||||
response.body = {
|
||||
"ResponseMetadata" => { "RequestId" => Fog::AWS::Mock.request_id },
|
||||
"DescribeDBEngineVersionsResult" => { "DBEngineVersions" => self.data[:db_engine_versions] }
|
||||
}
|
||||
response
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
7
tests/requests/rds/db_engine_versions.rb
Normal file
7
tests/requests/rds/db_engine_versions.rb
Normal file
|
@ -0,0 +1,7 @@
|
|||
Shindo.tests('AWS::RDS | describe db engine versions', ['aws', 'rds']) do
|
||||
tests('success') do
|
||||
tests("#describe_db_engine_versions").formats(AWS::RDS::Formats::DB_ENGINE_VERSIONS_LIST) do
|
||||
Fog::AWS[:rds].describe_db_engine_versions.body
|
||||
end
|
||||
end
|
||||
end
|
|
@ -291,6 +291,20 @@ class AWS
|
|||
'EventSubscriptionsList' => [EVENT_SUBSCRIPTION]
|
||||
}
|
||||
}
|
||||
|
||||
DB_ENGINE_VERSION = {
|
||||
'Engine' => String,
|
||||
'DBParameterGroupFamily' => String,
|
||||
'DBEngineDescription' => String,
|
||||
'EngineVersion' => String,
|
||||
'DBEngineVersionDescription' => String
|
||||
}
|
||||
|
||||
DB_ENGINE_VERSIONS_LIST = BASIC.merge(
|
||||
'DescribeDBEngineVersionsResult' => {
|
||||
'DBEngineVersions' => [DB_ENGINE_VERSION]
|
||||
}
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue