revise linode expected results

This commit is contained in:
Marques Johansson 2014-09-03 02:01:30 -04:00
parent 2b1af6951f
commit b766545916
2 changed files with 18 additions and 13 deletions

View File

@ -49,12 +49,12 @@ module Fog
"DESCRIPTION" => "Fog Mock Linode Image #{image_id}",
"LABEL" => "test_#{image_id}_image",
"STATUS" => status,
"SIZE" => size,
"TYPE" => "manual",
"ISPUBLIC" => rand(0...1),
"CREATE_DT" => "2014-06-29 5:39:19.0",
"USED" => rand(0...size),
"MINSIZE" => Fog::Mock.random_numbers(5),
"FS_TYPE" => "ext4",
"USERID" => Fog::Mock.random_numbers(5),
"CREATOR" => "test_username",
"IMAGEID" => image_id
}
end

View File

@ -36,7 +36,7 @@ Shindo.tests('Fog::Compute[:linode] | linode requests', ['linode']) do
})
@ip_format = Linode::Compute::Formats::BASIC.merge({
'DATA' => { 'IPAddressID' => Integer }
'DATA' => { 'IPADDRESSID' => Integer, 'IPADDRESS' => String }
})
@disks_format = Linode::Compute::Formats::BASIC.merge({
@ -58,13 +58,13 @@ Shindo.tests('Fog::Compute[:linode] | linode requests', ['linode']) do
"LAST_USED_DT" => String,
"DESCRIPTION" => String,
"LABEL" => String,
"STATUS" => Integer,
"SIZE" => Integer
"STATUS" => String,
"TYPE" => String,
"MINSIZE" => Integer,
"ISPUBLIC" => Integer,
"CREATE_DT" => String,
"USED" => Integer,
"FS_TYPE" => String,
"USERID" => Integer,
"CREATOR" => String,
"IMAGEID" => Integer
}]
})
@ -73,6 +73,10 @@ Shindo.tests('Fog::Compute[:linode] | linode requests', ['linode']) do
'DATA' => { 'JobID' => Integer, 'DiskID' => Integer }
})
@disk_createfromimage_format = Linode::Compute::Formats::BASIC.merge({
'DATA' => { 'JOBID' => Integer, 'DISKID' => Integer }
})
@disk_resize_format = Linode::Compute::Formats::BASIC.merge({
'DATA' => { 'JobID' => Integer }
})
@ -109,7 +113,8 @@ Shindo.tests('Fog::Compute[:linode] | linode requests', ['linode']) do
tests('#linode_update').formats(@linode_format) do
pending if Fog.mocking?
Fog::Compute[:linode].linode_update(@linode_id, :label => 'testing').body
rand_label = 'testing' + Fog::Mock.random_letters(6)
Fog::Compute[:linode].linode_update(@linode_id, :label => rand_label).body
end
tests('#linode_ip_addprivate').formats(@ip_format) do
@ -136,7 +141,7 @@ Shindo.tests('Fog::Compute[:linode] | linode requests', ['linode']) do
tests('#linode_disk_resize').formats(@disk_resize_format) do
pending if Fog.mocking?
Fog::Compute[:linode].linode_disk_resize(@linode_id, @disk_id, 2).body
Fog::Compute[:linode].linode_disk_resize(@linode_id, @disk1_id, 2).body
end
tests('#linode_disk_imagize').formats(@disk_imagize_format) do
@ -148,15 +153,15 @@ Shindo.tests('Fog::Compute[:linode] | linode requests', ['linode']) do
tests('#linode_disk_createfromdistribution').formats(@disk_format) do
pending if Fog.mocking?
data = Fog::Compute[:linode].linode_disk_createfromdistribution(@linode_id, 73, 'test1', 600, 'P@SSW)RD').body
data = Fog::Compute[:linode].linode_disk_createfromdistribution(@linode_id, 124, 'test1', 750, 'P@SSW)RD').body
@disk2_id = data['DATA']['DiskID']
data
end
tests('#linode_disk_createfromimage').formats(@disk_format) do
tests('#linode_disk_createfromimage').formats(@disk_createfromimage_format) do
pending if Fog.mocking?
data = Fog::Compute[:linode].linode_disk_createfromimage(@linode_id, @image1_id, 3, 'P@SSW)RD', '').body
@disk3_id = data['DATA']['DiskID']
@disk3_id = data['DATA']['DISKID']
data
end