2010-09-09 20:50:38 -04:00
|
|
|
Shindo.tests('Rackspace::Compute | 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
|
2010-10-13 20:54:14 -04:00
|
|
|
pending if Fog.mocking?
|
2010-09-09 20:50:38 -04:00
|
|
|
Rackspace[:compute].get_flavor_details(1).body['flavor']
|
|
|
|
end
|
|
|
|
|
|
|
|
tests('#list_flavors').formats({'flavors' => [Rackspace::Compute::Formats::SUMMARY]}) do
|
2010-10-13 20:54:14 -04:00
|
|
|
pending if Fog.mocking?
|
2010-09-09 20:50:38 -04:00
|
|
|
Rackspace[:compute].list_flavors.body
|
|
|
|
end
|
|
|
|
|
|
|
|
tests('#list_flavors_detail').formats({'flavors' => [@flavor_format]}) do
|
2010-10-13 20:54:14 -04:00
|
|
|
pending if Fog.mocking?
|
2010-09-09 20:50:38 -04:00
|
|
|
Rackspace[:compute].list_flavors_detail.body
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
tests('failure') do
|
|
|
|
|
|
|
|
tests('#get_flavor_details(0)').raises(Fog::Rackspace::Compute::NotFound) do
|
2010-10-13 20:54:14 -04:00
|
|
|
pending if Fog.mocking?
|
2010-09-09 20:50:38 -04:00
|
|
|
Rackspace[:compute].get_flavor_details(0)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|