2011-06-16 19:28:54 -04:00
|
|
|
Shindo.tests('Fog::Compute[:rackspace] | flavor requests', ['rackspace']) do
|
2010-09-09 20:50:38 -04:00
|
|
|
|
|
|
|
@flavor_format = {
|
|
|
|
'disk' => Integer,
|
|
|
|
'id' => Integer,
|
|
|
|
'name' => String,
|
|
|
|
'ram' => Integer
|
|
|
|
}
|
|
|
|
|
2012-12-20 15:00:13 -05:00
|
|
|
@service = Fog::Compute.new(:provider => :rackspace, :version => :v1)
|
2010-09-09 20:50:38 -04:00
|
|
|
|
2012-12-20 15:00:13 -05:00
|
|
|
tests('success') do
|
2010-09-09 20:50:38 -04:00
|
|
|
tests('#get_flavor_details(1)').formats(@flavor_format) do
|
2010-10-13 20:54:14 -04:00
|
|
|
pending if Fog.mocking?
|
2012-12-20 15:00:13 -05:00
|
|
|
@service.get_flavor_details(1).body['flavor']
|
2010-09-09 20:50:38 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
tests('#list_flavors').formats({'flavors' => [Rackspace::Compute::Formats::SUMMARY]}) do
|
2010-10-13 20:54:14 -04:00
|
|
|
pending if Fog.mocking?
|
2012-12-20 15:00:13 -05:00
|
|
|
@service.list_flavors.body
|
2010-09-09 20:50:38 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
tests('#list_flavors_detail').formats({'flavors' => [@flavor_format]}) do
|
2010-10-13 20:54:14 -04:00
|
|
|
pending if Fog.mocking?
|
2012-12-20 15:00:13 -05:00
|
|
|
@service.list_flavors_detail.body
|
2010-09-09 20:50:38 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
tests('failure') do
|
|
|
|
|
2011-06-16 19:28:54 -04:00
|
|
|
tests('#get_flavor_details(0)').raises(Fog::Compute::Rackspace::NotFound) do
|
2010-10-13 20:54:14 -04:00
|
|
|
pending if Fog.mocking?
|
2012-12-20 15:00:13 -05:00
|
|
|
@service.get_flavor_details(0)
|
2010-09-09 20:50:38 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|