1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[openstack|image] Fix Hash Access on Mock of Create Image

Signed-off-by: Nelvin Driz <nelvindriz@live.com>
This commit is contained in:
Nelvin Driz 2012-09-07 16:37:56 +08:00
parent ad0e84be56
commit b863ba8a10
2 changed files with 14 additions and 14 deletions

View file

@ -51,12 +51,12 @@ module Fog
response.status = 201
response.body = {
'image'=> {
'name' => attributes[:name],
'name' => attributes['name'],
'size' => Fog::Mock.random_numbers(8).to_i,
'min_disk' => 0,
'disk_format' => attributes[:disk_format],
'disk_format' => attributes['disk_format'],
'created_at' => Time.now.to_s,
'container_format' => attributes[:container_format],
'container_format' => attributes['container_format'],
'deleted_at' => nil,
'updated_at' => Time.now.to_s,
'checksum' => Fog::Mock.random_hex(32),
@ -66,8 +66,8 @@ module Fog
'is_public' => false,
'status' => 'queued',
'min_ram' => 0,
'owner' => attributes[:owner],
'properties' => attributes[:properties]
'owner' => attributes['owner'],
'properties' => attributes['properties']
}
}
response

View file

@ -1,15 +1,15 @@
Shindo.tests('Fog::Image[:openstack] | image requests', ['openstack']) do
openstack = Fog::Identity[:openstack]
@image_attributes = {
:name => 'new image',
:owner => openstack.current_tenant['id'],
:is_public => 'true',
:copy_from => 'http://website.com/image.iso',
:disk_format => 'iso',
:properties=>
{:user_id => openstack.current_user['id'],
:owner_id => openstack.current_tenant['id']},
:container_format => 'bare' }
'name' => 'new image',
'owner' => openstack.current_tenant['id'],
'is_public' => 'true',
'copy_from' => 'http://website.com/image.iso',
'disk_format' => 'iso',
'properties' =>
{'user_id' => openstack.current_user['id'],
'owner_id' => openstack.current_tenant['id']},
'container_format'=> 'bare' }
@image_format = {
'name' => String,