2010-09-09 17:50:38 -07:00
|
|
|
Shindo.tests('Slicehost::Compute | flavor requests', ['slicehost']) do
|
2010-05-31 21:39:17 -07: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 17:54:14 -07:00
|
|
|
pending if Fog.mocking?
|
2010-09-09 17:50:38 -07:00
|
|
|
Slicehost[:compute].get_flavor(1).body
|
2010-05-31 21:39:17 -07:00
|
|
|
end
|
|
|
|
|
|
|
|
tests('#get_flavors').formats({ 'flavors' => [@flavor_format] }) do
|
2010-10-13 17:54:14 -07:00
|
|
|
pending if Fog.mocking?
|
2010-09-09 17:50:38 -07:00
|
|
|
Slicehost[:compute].get_flavors.body
|
2010-05-31 21:39:17 -07:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
tests('failure') do
|
|
|
|
|
|
|
|
tests('#get_flavor(0)').raises(Excon::Errors::Forbidden) do
|
2010-10-13 17:54:14 -07:00
|
|
|
pending if Fog.mocking?
|
2010-09-09 17:50:38 -07:00
|
|
|
Slicehost[:compute].get_flavor(0)
|
2010-05-31 21:39:17 -07:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|