[ibm|compute] Add request test for list_vlans and fix mock
This commit is contained in:
parent
2ade6c329e
commit
80c531a17c
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue