2011-06-16 19:28:54 -04:00
|
|
|
Shindo.tests('Fog::Compute[:slicehost] | flavor requests', ['slicehost']) do
|
2010-06-01 00:39:17 -04:00
|
|
|
|
|
|
|
@flavor_format = {
|
|
|
|
'id' => Integer,
|
|
|
|
'name' => String,
|
|
|
|
'price' => Integer,
|
|
|
|
'ram' => Integer
|
|
|
|
}
|
|
|
|
|
|
|
|
tests('success') do
|
|
|
|
|
|
|
|
tests('#get_flavor(1)').formats(@flavor_format) do
|
2010-10-13 20:54:14 -04:00
|
|
|
pending if Fog.mocking?
|
2011-06-16 19:28:54 -04:00
|
|
|
Fog::Compute[:slicehost].get_flavor(1).body
|
2010-06-01 00:39:17 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
tests('#get_flavors').formats({ 'flavors' => [@flavor_format] }) do
|
2010-10-13 20:54:14 -04:00
|
|
|
pending if Fog.mocking?
|
2011-06-16 19:28:54 -04:00
|
|
|
Fog::Compute[:slicehost].get_flavors.body
|
2010-06-01 00:39:17 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
tests('failure') do
|
|
|
|
|
|
|
|
tests('#get_flavor(0)').raises(Excon::Errors::Forbidden) do
|
2010-10-13 20:54:14 -04:00
|
|
|
pending if Fog.mocking?
|
2011-06-16 19:28:54 -04:00
|
|
|
Fog::Compute[:slicehost].get_flavor(0)
|
2010-06-01 00:39:17 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|