1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/tests/rackspace/requests/compute/flavor_tests.rb

40 lines
973 B
Ruby
Raw Normal View History

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
}
@service = Fog::Compute.new(:provider => :rackspace, :version => :v1)
2010-09-09 20:50:38 -04:00
tests('success') do
2010-09-09 20:50:38 -04:00
tests('#get_flavor_details(1)').formats(@flavor_format) do
pending if Fog.mocking?
@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
pending if Fog.mocking?
@service.list_flavors.body
2010-09-09 20:50:38 -04:00
end
tests('#list_flavors_detail').formats({'flavors' => [@flavor_format]}) do
pending if Fog.mocking?
@service.list_flavors_detail.body
2010-09-09 20:50:38 -04:00
end
end
tests('failure') do
tests('#get_flavor_details(0)').raises(Fog::Compute::Rackspace::NotFound) do
pending if Fog.mocking?
@service.get_flavor_details(0)
2010-09-09 20:50:38 -04:00
end
end
end