1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Add tests for flavor.

This commit is contained in:
Rupak Ganguly 2012-04-03 18:49:27 -04:00
parent 7956149306
commit 49e4cd0cba

View file

@ -0,0 +1,39 @@
Shindo.tests('Fog::Compute[:hp] | flavor requests', ['hp']) do
@flavor_format = {
'disk' => Integer,
'ram' => Integer,
'id' => Integer,
'name' => String
}
@list_flavors_format = {
'id' => Integer,
'name' => String
}
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(0)').raises(Fog::Compute::HP::NotFound) do
Fog::Compute[:hp].get_flavor_details(0)
end
end
end