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
Carlos Sanchez 4c2736d0c2 [google][compute] Update to API v1
Simplify attachment of boot disk, get_as_boot_disk no longer needed
Add missing Disk.get_object method
Allow setting deviceName when attaching a disk
Add disks mocks
2013-12-19 21:37:46 +01:00

82 lines
1.9 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,
'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' => [@get_image_format]
}
tests('success') do
image_name = 'test-image'
source = 'https://www.google.com/images/srpr/logo4w.png'
tests("#insert_image").formats(@insert_image_format) do
pending if Fog.mocking?
@google.insert_image(image_name, source).body
end
tests("#get_image").formats(@get_image_format) do
pending if Fog.mocking?
@google.insert_image(image_name, source)
@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
pending if Fog.mocking?
@google.insert_image(image_name, source)
@google.delete_image(image_name).body
end
end
end