1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/tests/rackspace/requests/compute_v2/image_tests.rb
2012-08-06 20:38:48 -04:00

47 lines
1.2 KiB
Ruby

Shindo.tests('Fog::Compute::RackspaceV2 | image_tests', ['rackspace']) do
pending if Fog.mocking?
IMAGE_FORMAT = {
'id' => String,
'name' => String,
'created' => Fog::Nullable::String,
'updated' => Fog::Nullable::String,
'status' => Fog::Nullable::String,
'user_id' => Fog::Nullable::String,
'tenant_id' => Fog::Nullable::String,
'progress' => Fog::Nullable::Integer,
'minDisk' => Fog::Nullable::Integer,
'minRam' => Fog::Nullable::Integer,
'metadata' => Fog::Nullable::Hash,
'OS-DCF:diskConfig' => Fog::Nullable::String,
'links' => [{
'rel' => String,
'href' => String,
'type' => Fog::Nullable::String
}]
}
LIST_IMAGE_FORMAT = {
'images' => [IMAGE_FORMAT]
}
GET_IMAGE_FORMAT = {
'image' => IMAGE_FORMAT
}
service = Fog::Compute.new(:provider => 'Rackspace', :version => 'V2')
image_id = nil
tests('success') do
tests('#list_images').formats(LIST_IMAGE_FORMAT) do
body = service.list_images.body
image_id = body['images'][0]['id']
body
end
tests('#get_image').formats(GET_IMAGE_FORMAT) do
service.get_image(image_id).body
end
end
end