mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[ibm|compute] Add request test for list_vlans and fix mock
This commit is contained in:
parent
2ade6c329e
commit
80c531a17c
2 changed files with 23 additions and 7 deletions
|
@ -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
|
||||
|
||||
|
|
21
tests/ibm/requests/compute/vlan_tests.rb
Normal file
21
tests/ibm/requests/compute/vlan_tests.rb
Normal 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
|
Loading…
Add table
Reference in a new issue