1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/tests/google/requests/compute/image_tests.rb
2013-01-16 17:55:36 -08:00

78 lines
1.7 KiB
Ruby

Shindo.tests('Fog::Compute[:google] | image requests', ['google']) do
@google = Fog::Compute[:google]
@insert_image_format = {
'kind' => String,
'id' => String,
'selfLink' => String,
'name' => String,
'targetLink' => String,
'status' => String,
'user' => String,
'progress' => Integer,
'insertTime' => String,
'startTime' => String,
'operationType' => String
}
@get_image_format = {
'kind' => String,
'id' => String,
'creationTimestamp' => String,
'selfLink' => String,
'name' => String,
'description' => String,
'sourceType' => String,
'preferredKernel' => String,
'rawDisk' => {
'containerType' => String,
'source' => String
}
}
@delete_image_format = {
'kind' => String,
'id' => String,
'selfLink' => String,
'name' => String,
'targetLink' => String,
'status' => String,
'user' => String,
'progress' => Integer,
'insertTime' => String,
'startTime' => String,
'operationType' => String
}
@list_images_format = {
'kind' => String,
'id' => String,
'selfLink' => String,
'items' => []
}
tests('success') do
image_name = 'ubuntu-12-04-v20120912'
source_type = 'RAW'
tests("#insert_image").formats(@insert_image_format) do
@google.insert_image(image_name, source_type).body
end
tests("#get_image").formats(@get_image_format) do
@google.get_image(image_name).body
end
tests("#list_images").formats(@list_images_format) do
@google.list_images.body
end
tests("#delete_image").formats(@delete_image_format) do
@google.delete_image(image_name).body
end
end
end