2011-06-16 16:28:54 -07:00
|
|
|
Shindo.tests('Fog::Compute[:slicehost] | image requests', ['slicehost']) do
|
2010-05-31 21:39:17 -07:00
|
|
|
|
|
|
|
@image_format = {
|
|
|
|
'id' => Integer,
|
|
|
|
'name' => String
|
|
|
|
}
|
|
|
|
|
|
|
|
tests('success') do
|
|
|
|
|
|
|
|
tests('#get_image(19)').formats(@image_format) do
|
2010-10-13 17:54:14 -07:00
|
|
|
pending if Fog.mocking?
|
2011-06-16 16:28:54 -07:00
|
|
|
Fog::Compute[:slicehost].get_image(19).body
|
2010-05-31 21:39:17 -07:00
|
|
|
end
|
|
|
|
|
|
|
|
tests('#get_images').formats({ 'images' => [@image_format] }) do
|
2010-10-13 17:54:14 -07:00
|
|
|
pending if Fog.mocking?
|
2011-06-16 16:28:54 -07:00
|
|
|
Fog::Compute[:slicehost].get_images.body
|
2010-05-31 21:39:17 -07:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
tests('failure') do
|
|
|
|
|
|
|
|
tests('#get_image(0)').raises(Excon::Errors::Forbidden) do
|
2010-10-13 17:54:14 -07:00
|
|
|
pending if Fog.mocking?
|
2011-06-16 16:28:54 -07:00
|
|
|
Fog::Compute[:slicehost].get_image(0)
|
2010-05-31 21:39:17 -07:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|