mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
mock related fixes and marking unmocked tests pending
This commit is contained in:
parent
b224ccb823
commit
592c8cc404
26 changed files with 95 additions and 21 deletions
|
@ -51,6 +51,7 @@ module Fog
|
|||
response.body = {
|
||||
'requestId' => Fog::AWS::Mock.request_id
|
||||
}.merge!(data)
|
||||
@data[:snapshots][snapshot_id]['tagSet'] = {}
|
||||
else
|
||||
response.status = 400
|
||||
raise(Excon::Errors.status_error({:expects => 200}, response))
|
||||
|
|
|
@ -44,10 +44,10 @@ module Fog
|
|||
response = Excon::Response.new
|
||||
|
||||
availability_zone_info = [
|
||||
{"regionName"=>"us-east-1", "zoneName"=>"us-east-1a", "zoneState"=>"available"},
|
||||
{"regionName"=>"us-east-1", "zoneName"=>"us-east-1b", "zoneState"=>"available"},
|
||||
{"regionName"=>"us-east-1", "zoneName"=>"us-east-1c", "zoneState"=>"available"},
|
||||
{"regionName"=>"us-east-1", "zoneName"=>"us-east-1d", "zoneState"=>"available"}
|
||||
{"messageSet" => [], "regionName" => "us-east-1", "zoneName" => "us-east-1a", "zoneState" => "available"},
|
||||
{"messageSet" => [], "regionName" => "us-east-1", "zoneName" => "us-east-1b", "zoneState" => "available"},
|
||||
{"messageSet" => [], "regionName" => "us-east-1", "zoneName" => "us-east-1c", "zoneState" => "available"},
|
||||
{"messageSet" => [], "regionName" => "us-east-1", "zoneName" => "us-east-1d", "zoneState" => "available"},
|
||||
]
|
||||
|
||||
aliases = {'region-name' => 'regionName', 'zone-name' => 'zoneName', 'state' => 'zoneState'}
|
||||
|
@ -58,8 +58,8 @@ module Fog
|
|||
|
||||
response.status = 200
|
||||
response.body = {
|
||||
'requestId' => Fog::AWS::Mock.request_id,
|
||||
'availabilityZoneInfo' => availability_zone_info
|
||||
'availabilityZoneInfo' => availability_zone_info,
|
||||
'requestId' => Fog::AWS::Mock.request_id
|
||||
}
|
||||
response
|
||||
end
|
||||
|
|
|
@ -74,7 +74,7 @@ module Fog
|
|||
filters = {'instance-id' => [*filters]}
|
||||
end
|
||||
|
||||
if Fog.mocking? && filter.keys.any? {|key| key =~ /^tag/}
|
||||
if filters.keys.any? {|key| key =~ /^tag/}
|
||||
Formatador.display_line("[yellow][WARN] describe_instances tag filters are not yet mocked[/] [light_black](#{caller.first})[/]")
|
||||
Fog::Mock.not_implemented
|
||||
end
|
||||
|
@ -184,7 +184,7 @@ module Fog
|
|||
'ownerId' => instance['ownerId'],
|
||||
'reservationId' => instance['reservationId']
|
||||
}
|
||||
reservation_set[instance['reservationId']]['instancesSet'] << instance.reject{|key,value| !['amiLaunchIndex', 'architecture', 'blockDeviceMapping', 'clientToken', 'dnsName', 'imageId', 'instanceId', 'instanceState', 'instanceType', 'ipAddress', 'kernelId', 'keyName', 'launchTime', 'monitoring', 'placement', 'privateDnsName', 'privateIpAddress', 'productCodes', 'ramdiskId', 'reason', 'rootDeviceType'].include?(key)}
|
||||
reservation_set[instance['reservationId']]['instancesSet'] << instance.reject{|key,value| !['amiLaunchIndex', 'architecture', 'blockDeviceMapping', 'clientToken', 'dnsName', 'imageId', 'instanceId', 'instanceState', 'instanceType', 'ipAddress', 'kernelId', 'keyName', 'launchTime', 'monitoring', 'placement', 'privateDnsName', 'privateIpAddress', 'productCodes', 'ramdiskId', 'reason', 'rootDeviceType', 'stateReason', 'tagSet'].include?(key)}
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ module Fog
|
|||
Formatador.display_line("[yellow][WARN] describe_snapshots with a second param is deprecated, use describe_snapshots(options) instead[/] [light_black](#{caller.first})[/]")
|
||||
end
|
||||
|
||||
if Fog.mocking? && filter.keys.any? {|key| key =~ /^tag/}
|
||||
if filters.keys.any? {|key| key =~ /^tag/}
|
||||
Formatador.display_line("[yellow][WARN] describe_snapshots tag filters are not yet mocked[/] [light_black](#{caller.first})[/]")
|
||||
Fog::Mock.not_implemented
|
||||
end
|
||||
|
|
|
@ -49,7 +49,7 @@ module Fog
|
|||
filters = {'volume-id' => [*filters]}
|
||||
end
|
||||
|
||||
if Fog.mocking? && filter.keys.any? {|key| key =~ /^tag/}
|
||||
if filters.keys.any? {|key| key =~ /^tag/}
|
||||
Formatador.display_line("[yellow][WARN] describe_volumes tag filters are not yet mocked[/] [light_black](#{caller.first})[/]")
|
||||
Fog::Mock.not_implemented
|
||||
end
|
||||
|
|
|
@ -147,6 +147,8 @@ module Fog
|
|||
'ownerId' => @owner_id,
|
||||
'privateIpAddress' => nil,
|
||||
'reservationId' => reservation_id,
|
||||
'stateReason' => {},
|
||||
'tagSet' => {}
|
||||
})
|
||||
end
|
||||
response.body = {
|
||||
|
|
|
@ -9,7 +9,7 @@ module Fog
|
|||
# * response<~Excon::Response>:
|
||||
# * body<~Array>:
|
||||
# TODO: docs
|
||||
def avail_linodeplans(linodeplan_id=nil)
|
||||
def avail_linodeplans(linodeplan_id = nil)
|
||||
options = {}
|
||||
if linodeplan_id
|
||||
options.merge!(:planId => linodeplan_id)
|
||||
|
@ -25,7 +25,7 @@ module Fog
|
|||
|
||||
class Mock
|
||||
|
||||
def avail_linodeplans
|
||||
def avail_linodeplans(linodeplan_id = nil)
|
||||
Fog::Mock.not_implemented
|
||||
end
|
||||
|
||||
|
|
|
@ -47,12 +47,12 @@ module Fog
|
|||
'name' => options['name'] || '',
|
||||
'serverId' => server_id,
|
||||
'status' => 'SAVING',
|
||||
'updated' => now,
|
||||
'updated' => now.to_s,
|
||||
}
|
||||
|
||||
@data[:last_modified][:images][data['id']] = now
|
||||
@data[:images][data['id']] = data
|
||||
response.body = { 'image' => data.reject {|key, value| !['id', 'name', 'serverId'].include?(key)} }
|
||||
response.body = { 'image' => data.reject {|key, value| !['id', 'name', 'serverId', 'status', 'updated'].include?(key)} }
|
||||
response
|
||||
end
|
||||
|
||||
|
|
|
@ -32,14 +32,14 @@ module Fog
|
|||
for image in images
|
||||
case image['status']
|
||||
when 'SAVING'
|
||||
if Time.now - @data[:last_modified][:images][image['id']] > 2
|
||||
if Time.now - @data[:last_modified][:images][image['id']] > Fog::Mock.delay
|
||||
image['status'] = 'ACTIVE'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
response.status = [200, 203][rand(1)]
|
||||
response.body = { 'images' => images }
|
||||
response.body = { 'images' => images.map {|image| image.reject {|key, value| !['id', 'name', 'status', 'updated'].include?(key)}} }
|
||||
response
|
||||
end
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ describe 'SimpleDB.select' do
|
|||
end
|
||||
|
||||
it 'should return multi-value attributes when present' do
|
||||
pending if Fog.mocking?
|
||||
@item = "someitem_fog_domain_#{Time.now.to_i}"
|
||||
AWS[:sdb].put_attributes(@domain_name, @item, { "attr" => "foo" })
|
||||
AWS[:sdb].put_attributes(@domain_name, @item, { "attr" => "foo2" })
|
||||
|
|
|
@ -27,6 +27,7 @@ Shindo.tests('AWS::Compute | image requests', ['aws']) do
|
|||
# end
|
||||
|
||||
tests("#describe_images('ImageId' => '#{GENTOO_AMI}')").formats(@images_format) do
|
||||
pending if Fog.mocking?
|
||||
AWS[:compute].describe_images('ImageId' => GENTOO_AMI).body
|
||||
end
|
||||
|
||||
|
|
|
@ -15,14 +15,17 @@ Shindo.tests('AWS::Compute | tag requests', ['aws']) do
|
|||
tests('success') do
|
||||
|
||||
tests("#create_tags('#{@volume.identity}', 'foo' => 'bar')").formats(AWS::Compute::Formats::BASIC) do
|
||||
pending if Fog.mocking?
|
||||
AWS[:compute].create_tags(@volume.identity, 'foo' => 'bar').body
|
||||
end
|
||||
|
||||
tests('#describe_tags').formats(@tags_format) do
|
||||
pending if Fog.mocking?
|
||||
AWS[:compute].describe_tags.body
|
||||
end
|
||||
|
||||
tests("#delete_tags('#{@volume.identity}', 'foo' => 'bar')").formats(AWS::Compute::Formats::BASIC) do
|
||||
pending if Fog.mocking?
|
||||
AWS[:compute].delete_tags(@volume.identity, 'foo' => 'bar').body
|
||||
end
|
||||
|
||||
|
@ -31,10 +34,12 @@ Shindo.tests('AWS::Compute | tag requests', ['aws']) do
|
|||
tests('failure') do
|
||||
|
||||
tests("#create_tags('vol-00000000', 'baz' => 'qux')").raises(Fog::Service::NotFound) do
|
||||
pending if Fog.mocking?
|
||||
AWS[:compute].create_tags('vol-00000000', 'baz' => 'qux')
|
||||
end
|
||||
|
||||
tests("#delete_tags('vol-00000000', 'baz' => 'qux')").raises(Fog::Service::NotFound) do
|
||||
pending if Fog.mocking?
|
||||
AWS[:compute].delete_tags('vol-00000000', 'baz' => 'qux')
|
||||
end
|
||||
|
||||
|
|
|
@ -22,28 +22,37 @@ Shindo.tests('Bluebox::Compute | block requests', ['bluebox']) do
|
|||
@block_id = nil
|
||||
|
||||
tests("create_block('#{@product_id}', '#{@template_id}', 'password' => '#{@password}')").formats(@block_format) do
|
||||
pending if Fog.mocking?
|
||||
data = Bluebox[:compute].create_block(@product_id, @template_id, 'password' => @password).body
|
||||
@block_id = data['id']
|
||||
data
|
||||
end
|
||||
|
||||
Bluebox[:compute].servers.get(@block_id).wait_for { ready? }
|
||||
unless Fog.mocking?
|
||||
Bluebox[:compute].servers.get(@block_id).wait_for { ready? }
|
||||
end
|
||||
|
||||
tests("get_block('#{@block_id}')").formats(@block_format) do
|
||||
pending if Fog.mocking?
|
||||
Bluebox[:compute].get_block(@block_id).body
|
||||
end
|
||||
|
||||
tests("get_blocks").formats([@block_format.reject {|key,value| ['product', 'template'].include?(key)}]) do
|
||||
pending if Fog.mocking?
|
||||
Bluebox[:compute].get_blocks.body
|
||||
end
|
||||
|
||||
tests("reboot_block('#{@block_id}')").formats({'status' => String, 'text' => String}) do
|
||||
pending if Fog.mocking?
|
||||
Bluebox[:compute].reboot_block(@block_id).body
|
||||
end
|
||||
|
||||
Bluebox[:compute].servers.get(@block_id).wait_for { ready? }
|
||||
unless Fog.mocking?
|
||||
Bluebox[:compute].servers.get(@block_id).wait_for { ready? }
|
||||
end
|
||||
|
||||
tests("destroy_block('#{@block_id})'").formats({'text' => String}) do
|
||||
pending if Fog.mocking?
|
||||
Bluebox[:compute].destroy_block(@block_id).body
|
||||
end
|
||||
|
||||
|
@ -52,14 +61,17 @@ Shindo.tests('Bluebox::Compute | block requests', ['bluebox']) do
|
|||
tests('failure') do
|
||||
|
||||
tests("get_block('00000000-0000-0000-0000-000000000000')").raises(Fog::Bluebox::Compute::NotFound) do
|
||||
pending if Fog.mocking?
|
||||
Bluebox[:compute].get_block('00000000-0000-0000-0000-000000000000')
|
||||
end
|
||||
|
||||
tests("reboot_block('00000000-0000-0000-0000-000000000000')").raises(Fog::Bluebox::Compute::NotFound) do
|
||||
pending if Fog.mocking?
|
||||
Bluebox[:compute].reboot_block('00000000-0000-0000-0000-000000000000')
|
||||
end
|
||||
|
||||
tests("destroy_block('00000000-0000-0000-0000-000000000000')").raises(Fog::Bluebox::Compute::NotFound) do
|
||||
pending if Fog.mocking?
|
||||
Bluebox[:compute].destroy_block('00000000-0000-0000-0000-000000000000')
|
||||
end
|
||||
|
||||
|
|
|
@ -5,10 +5,12 @@ Shindo.tests('Bluebox::Compute | product requests', ['bluebox']) do
|
|||
@product_id = '94fd37a7-2606-47f7-84d5-9000deda52ae' # 1 GB
|
||||
|
||||
tests("get_product('#{@product_id}')").formats(Bluebox::Compute::Formats::PRODUCT) do
|
||||
pending if Fog.mocking?
|
||||
Bluebox[:compute].get_product(@product_id).body
|
||||
end
|
||||
|
||||
tests("get_products").formats([Bluebox::Compute::Formats::PRODUCT]) do
|
||||
pending if Fog.mocking?
|
||||
Bluebox[:compute].get_products.body
|
||||
end
|
||||
|
||||
|
@ -17,6 +19,7 @@ Shindo.tests('Bluebox::Compute | product requests', ['bluebox']) do
|
|||
tests('failure') do
|
||||
|
||||
tests("get_product('00000000-0000-0000-0000-000000000000')").raises(Fog::Bluebox::Compute::NotFound) do
|
||||
pending if Fog.mocking?
|
||||
Bluebox[:compute].get_product('00000000-0000-0000-0000-000000000000')
|
||||
end
|
||||
|
||||
|
|
|
@ -12,10 +12,12 @@ Shindo.tests('Bluebox::Compute | template requests', ['bluebox']) do
|
|||
@template_id = 'a00baa8f-b5d0-4815-8238-b471c4c4bf72' # Ubuntu 9.10 64bit
|
||||
|
||||
tests("get_template('#{@template_id}')").formats(@template_format) do
|
||||
pending if Fog.mocking?
|
||||
Bluebox[:compute].get_template(@template_id).body
|
||||
end
|
||||
|
||||
tests("get_templates").formats([@template_format]) do
|
||||
pending if Fog.mocking?
|
||||
Bluebox[:compute].get_templates.body
|
||||
end
|
||||
|
||||
|
@ -24,6 +26,7 @@ Shindo.tests('Bluebox::Compute | template requests', ['bluebox']) do
|
|||
tests('failure') do
|
||||
|
||||
tests("get_template('00000000-0000-0000-0000-000000000000')").raises(Fog::Bluebox::Compute::NotFound) do
|
||||
pending if Fog.mocking?
|
||||
Bluebox[:compute].get_template('00000000-0000-0000-0000-000000000000')
|
||||
end
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ Shindo.tests('Linode::Compute | datacenter requests', ['linode']) do
|
|||
tests('success') do
|
||||
|
||||
tests('#avail_datacenters').formats(@datacenters_format) do
|
||||
pending if Fog.mocking?
|
||||
Linode[:compute].avail_datacenters.body
|
||||
end
|
||||
|
||||
|
|
|
@ -16,12 +16,14 @@ Shindo.tests('Linode::Compute | distribution requests', ['linode']) do
|
|||
@distribution_id = nil
|
||||
|
||||
tests('#avail_distributions').formats(@distributions_format) do
|
||||
pending if Fog.mocking?
|
||||
data = Linode[:compute].avail_distributions.body
|
||||
@distribution_id = data['DATA'].first['DISTRIBUTIONID']
|
||||
data
|
||||
end
|
||||
|
||||
tests("@avail_distributions(#{@distribution_id})").formats(@distributions_format) do
|
||||
pending if Fog.mocking?
|
||||
Linode[:compute].avail_distributions(@distribution_id).body
|
||||
end
|
||||
|
||||
|
|
|
@ -41,16 +41,19 @@ Shindo.tests('Linode::Compute | linode requests', ['linode']) do
|
|||
|
||||
# (2 => Dallas, TX, USA), (1 => 1 month), (1 => Linode 512)
|
||||
tests('#linode_create(2, 1, 1)').formats(@linode_format) do
|
||||
pending if Fog.mocking?
|
||||
data = Linode[:compute].linode_create(2, 1, 1).body
|
||||
@linode_id = data['DATA']['LinodeID']
|
||||
data
|
||||
end
|
||||
|
||||
tests("#linode_list(#{@linode_id})").formats(@linodes_format) do
|
||||
pending if Fog.mocking?
|
||||
Linode[:compute].linode_list(@linode_id).body
|
||||
end
|
||||
|
||||
tests('#linode_list').formats(@linodes_format) do
|
||||
pending if Fog.mocking?
|
||||
Linode[:compute].linode_list.body
|
||||
end
|
||||
|
||||
|
@ -59,6 +62,7 @@ Shindo.tests('Linode::Compute | linode requests', ['linode']) do
|
|||
# end
|
||||
|
||||
tests('#linode_delete(#{@linode_id})').succeeds do
|
||||
pending if Fog.mocking?
|
||||
Linode[:compute].linode_delete(@linode_id)
|
||||
end
|
||||
|
||||
|
@ -67,10 +71,12 @@ Shindo.tests('Linode::Compute | linode requests', ['linode']) do
|
|||
tests('failure') do
|
||||
|
||||
tests('#linode_reboot(0)').raises(Fog::Linode::Compute::NotFound) do
|
||||
pending if Fog.mocking?
|
||||
Linode[:compute].linode_reboot(0)
|
||||
end
|
||||
|
||||
tests('#linode_delete(0)').raises(Fog::Linode::Compute::NotFound) do
|
||||
pending if Fog.mocking?
|
||||
Linode[:compute].linode_delete(0)
|
||||
end
|
||||
|
||||
|
|
|
@ -23,12 +23,14 @@ Shindo.tests('Linode::Compute | linodeplans requests', ['linode']) do
|
|||
@linodeplan_id = nil
|
||||
|
||||
tests('#avail_linodeplans').formats(@linodeplans_format) do
|
||||
pending if Fog.mocking?
|
||||
data = Linode[:compute].avail_linodeplans.body
|
||||
@linodeplan_id = data['DATA'].first['PLANID']
|
||||
data
|
||||
end
|
||||
|
||||
tests("#avail_linodeplans(#{@linodeplan_id})").formats(@linodeplans_format) do
|
||||
pending if Fog.mocking?
|
||||
Linode[:compute].avail_linodeplans(@linodeplan_id).body
|
||||
end
|
||||
|
||||
|
|
|
@ -10,14 +10,17 @@ Shindo.tests('Rackspace::Compute | flavor requests', ['rackspace']) do
|
|||
tests('success') do
|
||||
|
||||
tests('#get_flavor_details(1)').formats(@flavor_format) do
|
||||
pending if Fog.mocking?
|
||||
Rackspace[:compute].get_flavor_details(1).body['flavor']
|
||||
end
|
||||
|
||||
tests('#list_flavors').formats({'flavors' => [Rackspace::Compute::Formats::SUMMARY]}) do
|
||||
pending if Fog.mocking?
|
||||
Rackspace[:compute].list_flavors.body
|
||||
end
|
||||
|
||||
tests('#list_flavors_detail').formats({'flavors' => [@flavor_format]}) do
|
||||
pending if Fog.mocking?
|
||||
Rackspace[:compute].list_flavors_detail.body
|
||||
end
|
||||
|
||||
|
@ -26,6 +29,7 @@ Shindo.tests('Rackspace::Compute | flavor requests', ['rackspace']) do
|
|||
tests('failure') do
|
||||
|
||||
tests('#get_flavor_details(0)').raises(Fog::Rackspace::Compute::NotFound) do
|
||||
pending if Fog.mocking?
|
||||
Rackspace[:compute].get_flavor_details(0)
|
||||
end
|
||||
|
||||
|
|
|
@ -24,9 +24,12 @@ Shindo.tests('Rackspace::Compute | image requests', ['rackspace']) do
|
|||
data
|
||||
end
|
||||
|
||||
Rackspace[:compute].images.get(@image_id).wait_for { ready? }
|
||||
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
|
||||
|
||||
|
@ -38,7 +41,12 @@ Shindo.tests('Rackspace::Compute | image requests', ['rackspace']) 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
|
||||
|
||||
|
@ -53,6 +61,7 @@ Shindo.tests('Rackspace::Compute | image requests', ['rackspace']) do
|
|||
end
|
||||
|
||||
tests('#get_image_details(0)').raises(Fog::Rackspace::Compute::NotFound) do
|
||||
pending if Fog.mocking?
|
||||
Rackspace[:compute].get_image_details(0)
|
||||
end
|
||||
|
||||
|
|
|
@ -49,12 +49,14 @@ Shindo.tests('Rackspace::Compute | server requests', ['rackspace']) do
|
|||
Rackspace[:compute].servers.get(@server_id).wait_for { ready? }
|
||||
|
||||
tests("#reboot_server(#{@server_id}, 'HARD')").succeeds do
|
||||
pending if Fog.mocking?
|
||||
Rackspace[:compute].reboot_server(@server_id, 'HARD')
|
||||
end
|
||||
|
||||
Rackspace[:compute].servers.get(@server_id).wait_for { ready? }
|
||||
|
||||
tests("#reboot_server(#{@server_id}, 'SOFT')").succeeds do
|
||||
pending if Fog.mocking?
|
||||
Rackspace[:compute].reboot_server(@server_id, 'SOFT')
|
||||
end
|
||||
|
||||
|
@ -81,6 +83,7 @@ Shindo.tests('Rackspace::Compute | server requests', ['rackspace']) do
|
|||
end
|
||||
|
||||
tests('#reboot_server(0)').raises(Fog::Rackspace::Compute::NotFound) do
|
||||
pending if Fog.mocking?
|
||||
Rackspace[:compute].reboot_server(0)
|
||||
end
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ Shindo.tests('Slicehost::Compute | backup requests', ['slicehost']) do
|
|||
tests('success') do
|
||||
|
||||
tests('#get_backups').formats({ 'backups' => [@backup_format] }) do
|
||||
pending if Fog.mocking?
|
||||
Slicehost[:compute].get_backups.body
|
||||
end
|
||||
|
||||
|
|
|
@ -10,10 +10,12 @@ Shindo.tests('Slicehost::Compute | flavor requests', ['slicehost']) do
|
|||
tests('success') do
|
||||
|
||||
tests('#get_flavor(1)').formats(@flavor_format) do
|
||||
pending if Fog.mocking?
|
||||
Slicehost[:compute].get_flavor(1).body
|
||||
end
|
||||
|
||||
tests('#get_flavors').formats({ 'flavors' => [@flavor_format] }) do
|
||||
pending if Fog.mocking?
|
||||
Slicehost[:compute].get_flavors.body
|
||||
end
|
||||
|
||||
|
@ -22,6 +24,7 @@ Shindo.tests('Slicehost::Compute | flavor requests', ['slicehost']) do
|
|||
tests('failure') do
|
||||
|
||||
tests('#get_flavor(0)').raises(Excon::Errors::Forbidden) do
|
||||
pending if Fog.mocking?
|
||||
Slicehost[:compute].get_flavor(0)
|
||||
end
|
||||
|
||||
|
|
|
@ -8,10 +8,12 @@ Shindo.tests('Slicehost::Compute | image requests', ['slicehost']) do
|
|||
tests('success') do
|
||||
|
||||
tests('#get_image(19)').formats(@image_format) do
|
||||
pending if Fog.mocking?
|
||||
Slicehost[:compute].get_image(19).body
|
||||
end
|
||||
|
||||
tests('#get_images').formats({ 'images' => [@image_format] }) do
|
||||
pending if Fog.mocking?
|
||||
Slicehost[:compute].get_images.body
|
||||
end
|
||||
|
||||
|
@ -20,6 +22,7 @@ Shindo.tests('Slicehost::Compute | image requests', ['slicehost']) do
|
|||
tests('failure') do
|
||||
|
||||
tests('#get_image(0)').raises(Excon::Errors::Forbidden) do
|
||||
pending if Fog.mocking?
|
||||
Slicehost[:compute].get_image(0)
|
||||
end
|
||||
|
||||
|
|
|
@ -17,28 +17,37 @@ Shindo.tests('Slicehost::Compute | slice requests', ['slicehost']) do
|
|||
@slice_id = nil
|
||||
|
||||
tests("#create_slice(1, 19, 'fogcreateslice')").formats(@slice_format.merge('root-password' => String)) do
|
||||
pending if Fog.mocking?
|
||||
data = Slicehost[:compute].create_slice(1, 19, 'fogcreateslice').body
|
||||
@slice_id = data['id']
|
||||
data
|
||||
end
|
||||
|
||||
Slicehost[:compute].servers.get(@slice_id).wait_for { ready? }
|
||||
unless Fog.mocking?
|
||||
Slicehost[:compute].servers.get(@slice_id).wait_for { ready? }
|
||||
end
|
||||
|
||||
tests("#get_slice(#{@slice_id})").formats(@slice_format) do
|
||||
pending if Fog.mocking?
|
||||
Slicehost[:compute].get_slice(@slice_id).body
|
||||
end
|
||||
|
||||
tests("#get_slices").formats({'slices' => [@slice_format]}) do
|
||||
pending if Fog.mocking?
|
||||
Slicehost[:compute].get_slices.body
|
||||
end
|
||||
|
||||
tests("#reboot_slice(#{@slice_id})").formats(@slice_format) do
|
||||
pending if Fog.mocking?
|
||||
Slicehost[:compute].reboot_slice(@slice_id).body
|
||||
end
|
||||
|
||||
Slicehost[:compute].servers.get(@slice_id).wait_for { ready? }
|
||||
unless Fog.mocking?
|
||||
Slicehost[:compute].servers.get(@slice_id).wait_for { ready? }
|
||||
end
|
||||
|
||||
tests("#delete_slice(#{@slice_id})").succeeds do
|
||||
pending if Fog.mocking?
|
||||
Slicehost[:compute].delete_slice(@slice_id)
|
||||
end
|
||||
|
||||
|
@ -47,14 +56,17 @@ Shindo.tests('Slicehost::Compute | slice requests', ['slicehost']) do
|
|||
tests('failure') do
|
||||
|
||||
tests('#get_slice(0)').raises(Excon::Errors::Forbidden) do
|
||||
pending if Fog.mocking?
|
||||
Slicehost[:compute].get_slice(0)
|
||||
end
|
||||
|
||||
tests('#reboot_slice(0)').raises(Excon::Errors::Forbidden) do
|
||||
pending if Fog.mocking?
|
||||
Slicehost[:compute].reboot_slice(0)
|
||||
end
|
||||
|
||||
tests('#delete_slice(0)').raises(Fog::Slicehost::Compute::NotFound) do
|
||||
pending if Fog.mocking?
|
||||
Slicehost[:compute].delete_slice(0)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue