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:
parent
7956149306
commit
49e4cd0cba
1 changed files with 39 additions and 0 deletions
39
tests/hp/requests/compute/flavor_tests.rb
Normal file
39
tests/hp/requests/compute/flavor_tests.rb
Normal 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
|
Loading…
Reference in a new issue