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

46 lines
1 KiB
Ruby
Raw Normal View History

2012-04-03 18:49:27 -04:00
Shindo.tests('Fog::Compute[:hp] | flavor requests', ['hp']) do
@flavor_format = {
'rxtx_quota' => Integer,
'rxtx_cap' => Integer,
'vcpus' => Integer,
'swap' => Integer,
'disk' => Integer,
'ram' => Integer,
'id' => Integer,
'links' => [Hash],
'name' => String
2012-04-03 18:49:27 -04:00
}
@list_flavors_format = {
'id' => Integer,
'name' => String,
'links' => [Hash]
2012-04-03 18:49:27 -04:00
}
tests('success') do
tests('#list_flavors').formats({'flavors' => [@list_flavors_format]}) do
Fog::Compute[:hp].list_flavors.body
end
tests('#get_flavor_details(1)').formats(@flavor_format) do
Fog::Compute[:hp].get_flavor_details(1).body['flavor']
end
tests('#list_flavors_detail').formats({'flavors' => [@flavor_format]}) do
Fog::Compute[:hp].list_flavors_detail.body
end
end
tests('failure') do
tests('#get_flavor_details(9999)').raises(Fog::Compute::HP::NotFound) do
Fog::Compute[:hp].get_flavor_details(9999)
2012-04-03 18:49:27 -04:00
end
end
end