mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
1bfc49fa71
Updates to the OpenStack address tests so that: * The tests cleanup after themselves when executed in Real mode. Previously running these tests in Real mode would leak servers and floating IPs. * DRY things up a bit. * Make use of the floating IP we create in subsequent tests. Previously the last floating IP in the full list was used. This could be problematic in some cases. -- Also adds a missing Mock class for the release_address request so that FOG_MOCK tests continue to pass.
34 lines
682 B
Ruby
34 lines
682 B
Ruby
module Fog
|
|
module Compute
|
|
class OpenStack
|
|
class Real
|
|
|
|
def release_address(address_id)
|
|
request(
|
|
:expects => [200, 202],
|
|
:method => 'DELETE',
|
|
:path => "os-floating-ips/#{address_id}"
|
|
)
|
|
end
|
|
|
|
end
|
|
|
|
class Mock
|
|
|
|
def release_address(address_id)
|
|
response = Excon::Response.new
|
|
response.status = 202
|
|
response.headers = {
|
|
"Content-Type" => "text/html; charset=UTF-8",
|
|
"Content-Length" => "0",
|
|
"Date" => Date.new
|
|
}
|
|
response.body = {}
|
|
response
|
|
end
|
|
|
|
end # mock
|
|
|
|
end
|
|
end
|
|
end
|