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

[ibm] Fix volume formats and mocks

This commit is contained in:
Decklin Foster 2012-03-12 15:29:18 -04:00
parent cb47ec8fc6
commit 599166e86b
2 changed files with 17 additions and 9 deletions

View file

@ -1,8 +1,8 @@
Shindo.tests('Fog::Storage[:ibm] | volume requests', ['ibm']) do
@combined_volume_format = {
@volume_format = {
"id" => String,
"instanceId" => String,
"instanceId" => Fog::Nullable::String,
"name" => String,
"format" => String,
"state" => Integer,
@ -12,6 +12,9 @@ Shindo.tests('Fog::Storage[:ibm] | volume requests', ['ibm']) do
"createdTime" => Integer,
"location" => String,
"productCodes" => Array,
}
@full_volume_format = @volume_format.merge({
"ioPrice" => {
"rate" => Float,
"unitOfMeasure" => String,
@ -20,14 +23,12 @@ Shindo.tests('Fog::Storage[:ibm] | volume requests', ['ibm']) do
"currencyCode" => String,
"pricePerQuantity" => Integer,
}
}
})
@volumes_format = {
'volumes' => [ @combined_volume_format.reject { |k,v| k == "ioPrice" } ]
'volumes' => [ @volume_format ]
}
@volume_format = @combined_volume_format.reject { |k,v| k == "instanceId" }
tests('success') do
@volume_id = nil
@ -54,7 +55,7 @@ Shindo.tests('Fog::Storage[:ibm] | volume requests', ['ibm']) do
Fog::Storage[:ibm].list_volumes.body
end
tests("#get_volume('#{@volume_id}')").formats(@volume_format) do
tests("#get_volume('#{@volume_id}')").formats(@full_volume_format) do
Fog::Storage[:ibm].get_volume(@volume_id).body
end