[ibm|compute] Add request test for list_vlans and fix mock

This commit is contained in:
Decklin Foster 2012-03-25 23:49:48 -04:00
parent 2ade6c329e
commit 80c531a17c
2 changed files with 23 additions and 7 deletions

View File

@ -34,15 +34,10 @@ module Fog
def list_vlans
response = Excon::Response.new
response.status = 200
response.body = {"addresses"=>
response.body = {"vlan"=>
[{"location"=>"101",
"mode"=>0,
"offeringId"=>"20001223",
"id"=>"75321",
"type"=>1,
"ip"=>"170.224.192.210 ",
"hostname"=>"170.224.192.210 ",
"state"=>2}]},
"name"=>"FOG-VLAN1"}]}
response
end

View File

@ -0,0 +1,21 @@
Shindo.tests('Fog::Compute[:ibm] | location requests', ['ibm']) do
@vlan_format = {
'id' => String,
'name' => String,
'location' => String,
}
@vlans_format = {
'vlan' => [ @vlan_format ]
}
tests('success') do
tests("#list_vlans").formats(@vlans_format) do
Fog::Compute[:ibm].list_vlans.body
end
end
end