mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[openstack|compute] Add mock method to list_address_pools
This commit is contained in:
parent
ed2d3aa3aa
commit
f969453c5e
2 changed files with 18 additions and 0 deletions
|
@ -16,6 +16,16 @@ module Fog
|
|||
|
||||
class Mock
|
||||
|
||||
def list_address_pools
|
||||
response = Excon::Response.new
|
||||
response.status = 200
|
||||
response.body = {
|
||||
'floating_ip_pools' => [
|
||||
{ 'name' => 'nova' }
|
||||
]
|
||||
}
|
||||
response
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -12,6 +12,10 @@ Shindo.tests('Fog::Compute[:openstack] | address requests', ['openstack']) do
|
|||
"pool" => String
|
||||
}
|
||||
|
||||
@address_pools_format = {
|
||||
"name" => String
|
||||
}
|
||||
|
||||
tests('success') do
|
||||
|
||||
tests('#allocate_address').formats({"floating_ip" => @address_format}) do
|
||||
|
@ -29,6 +33,10 @@ Shindo.tests('Fog::Compute[:openstack] | address requests', ['openstack']) do
|
|||
compute.get_address(@address_id).body
|
||||
end
|
||||
|
||||
tests('#list_address_pools').formats({"floating_ip_pools" => [@address_pools_format]}) do
|
||||
compute.list_address_pools.body
|
||||
end
|
||||
|
||||
compute.servers.get(@server_id).wait_for { ready? }
|
||||
|
||||
tests('#associate_address(server_id, ip_address)').succeeds do
|
||||
|
|
Loading…
Reference in a new issue