Sha256: c5a8d711b3780e92db6738dbe1219007bbb3568a476a5a2da7959f60233f1911
Contents?: true
Size: 1.86 KB
Versions: 17
Compression:
Stored size: 1.86 KB
Contents
Shindo.tests('Rackspace::Compute | image requests', ['rackspace']) do @image_format = { 'created' => Fog::Nullable::String, 'id' => Integer, 'name' => String, 'progress' => Fog::Nullable::Integer, 'serverId' => Fog::Nullable::Integer, 'status' => String, 'updated' => String } tests('success') do @server = Rackspace[:compute].servers.create(:flavor_id => 1, :image_id => 19) @server.wait_for { ready? } @image_id = nil tests("#create_image(#{@server.id})").formats(@image_format) do data = Rackspace[:compute].create_image(@server.id).body['image'] @image_id = data['id'] data end unless Fog.mocking? Rackspace[:compute].images.get(@image_id).wait_for { ready? } end tests("#get_image_details(#{@image_id})").formats(@image_format) do pending if Fog.mocking? Rackspace[:compute].get_image_details(@image_id).body['image'] end tests('#list_images').formats({'images' => [Rackspace::Compute::Formats::SUMMARY]}) do Rackspace[:compute].list_images.body end tests('#list_images_detail').formats({'images' => [@image_format]}) do Rackspace[:compute].list_images_detail.body end unless Fog.mocking? Rackspace[:compute].images.get(@image_id).wait_for { ready? } end tests("#delete_image(#{@image_id})").succeeds do pending if Fog.mocking? # because it will fail without the wait just above here, which won't work Rackspace[:compute].delete_image(@image_id) end @server.destroy end tests('failure') do tests('#delete_image(0)').raises(Excon::Errors::BadRequest) do Rackspace[:compute].delete_image(0) end tests('#get_image_details(0)').raises(Fog::Rackspace::Compute::NotFound) do pending if Fog.mocking? Rackspace[:compute].get_image_details(0) end end end
Version data entries
17 entries across 17 versions & 2 rubygems