1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/tests/serverlove/requests/compute/image_tests.rb

47 lines
1.4 KiB
Ruby
Raw Normal View History

2012-04-29 12:59:24 -04:00
Shindo.tests('Fog::Compute[:serverlove] | drive requests', ['serverlove']) do
@image_format = {
'drive' => String,
2012-04-29 12:59:24 -04:00
'name' => String,
'user' => String,
'size' => Integer,
'claimed' => Fog::Nullable::String,
2012-04-29 12:59:24 -04:00
'status' => String,
'encryption:cipher' => String,
'read:bytes' => String,
'write:bytes' => String,
'read:requests' => String,
'write:requests' => String
2012-04-29 12:59:24 -04:00
}
2012-04-29 12:59:24 -04:00
tests('success') do
attributes = { 'name' => 'Test', 'size' => '1234567890' }
2012-04-29 12:59:24 -04:00
tests("#create_image").formats(@image_format) do
@image = Fog::Compute[:serverlove].create_image(attributes).body
2012-04-29 12:59:24 -04:00
end
tests("#list_images").succeeds do
2012-04-29 12:59:24 -04:00
Fog::Compute[:serverlove].images
end
tests("#update_image").returns(true) do
@image['name'] = "Diff"
Fog::Compute[:serverlove].update_image(@image['drive'], { name: @image['name'], size: @image['size']})
Fog::Compute[:serverlove].images.get(@image['drive']).name == "Diff"
end
tests("#load_standard_image").succeeds do
# Load centos
Fog::Compute[:serverlove].load_standard_image(@image['drive'], '679f5f44-0be7-4745-a658-cccd4334c1aa')
end
tests("#destroy_image").succeeds do
Fog::Compute[:serverlove].destroy_image(@image['drive'])
end
2012-04-29 12:59:24 -04:00
end
end