mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[rackspace] consolidate flavor tests
This commit is contained in:
parent
b7808c6998
commit
af8db2922a
5 changed files with 34 additions and 41 deletions
|
@ -27,13 +27,6 @@ module Rackspace
|
|||
|
||||
module Formats
|
||||
|
||||
FLAVOR = {
|
||||
'disk' => Integer,
|
||||
'id' => Integer,
|
||||
'name' => String,
|
||||
'ram' => Integer
|
||||
}
|
||||
|
||||
IMAGE = {
|
||||
'created' => String,
|
||||
'id' => Integer,
|
||||
|
|
34
tests/rackspace/requests/servers/flavor_tests.rb
Normal file
34
tests/rackspace/requests/servers/flavor_tests.rb
Normal file
|
@ -0,0 +1,34 @@
|
|||
Shindo.tests('Rackspace::Servers | flavor requests', ['rackspace']) do
|
||||
|
||||
@flavor_format = {
|
||||
'disk' => Integer,
|
||||
'id' => Integer,
|
||||
'name' => String,
|
||||
'ram' => Integer
|
||||
}
|
||||
|
||||
tests('success') do
|
||||
|
||||
tests('#get_flavor_details(1)').formats(@flavor_format) do
|
||||
Rackspace[:servers].get_flavor_details(1).body['flavor']
|
||||
end
|
||||
|
||||
tests('#list_flavors').formats({'flavors' => [Rackspace::Servers::Formats::SUMMARY]}) do
|
||||
Rackspace[:servers].list_flavors.body
|
||||
end
|
||||
|
||||
tests('#list_flavors_detail').formats({'flavors' => [@flavor_format]}) do
|
||||
Rackspace[:servers].list_flavors_detail.body
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
tests('failure') do
|
||||
|
||||
tests('#get_flavor_details(0)').raises(Fog::Rackspace::Servers::NotFound) do
|
||||
Rackspace[:servers].get_flavor_details(0)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
|
@ -1,16 +0,0 @@
|
|||
Shindo.tests('Rackspace::Servers#get_flavor_details', 'rackspace') do
|
||||
tests('success') do
|
||||
|
||||
tests('#get_flavor_details(1)').formats(Rackspace::Servers::Formats::FLAVOR) do
|
||||
Rackspace[:servers].get_flavor_details(1).body['flavor']
|
||||
end
|
||||
|
||||
end
|
||||
tests('failure') do
|
||||
|
||||
tests('#get_flavor_details(0)').raises(Excon::Errors::NotFound) do
|
||||
Rackspace[:servers].get_flavor_details(0)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
|
@ -1,9 +0,0 @@
|
|||
Shindo.tests('Rackspace::Servers#list_flavors_detail', 'rackspace') do
|
||||
tests('success') do
|
||||
|
||||
tests('#list_flavors_detail').formats({'flavors' => [Rackspace::Servers::Formats::FLAVOR]}) do
|
||||
Rackspace[:servers].list_flavors_detail.body
|
||||
end
|
||||
|
||||
end
|
||||
end
|
|
@ -1,9 +0,0 @@
|
|||
Shindo.tests('Rackspace::Servers#list_flavors', 'rackspace') do
|
||||
tests('success') do
|
||||
|
||||
tests('#list_flavors').formats({'flavors' => [Rackspace::Servers::Formats::SUMMARY]}) do
|
||||
Rackspace[:servers].list_flavors.body
|
||||
end
|
||||
|
||||
end
|
||||
end
|
Loading…
Add table
Reference in a new issue