mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Fix minor things in tests.
This commit is contained in:
parent
241a74aa8c
commit
f0c8a7969a
1 changed files with 14 additions and 2 deletions
|
@ -20,11 +20,19 @@ Shindo.tests('Fog::Compute[:hp] | address requests', ['hp']) do
|
|||
data
|
||||
end
|
||||
|
||||
tests("#get_address('#{@address_id}')").formats(@floating_ips_format) do
|
||||
Fog::Compute[:hp].get_address(@address_id).body['floating_ip']
|
||||
end
|
||||
|
||||
@server = Fog::Compute[:hp].servers.create(:name => 'fogaddresstests', :flavor_id => 100, :image_id => 1242)
|
||||
@server.wait_for { ready? }
|
||||
|
||||
tests("#associate_address('#{@server.id}', '#{@ip_address}')").succeeds do
|
||||
Fog::Compute[:hp].associate_address(@server.id, @ip_address)
|
||||
tests("#get_address").returns(@server.id, "associated to valid instance id") do
|
||||
pending if Fog.mocking?
|
||||
Fog::Compute[:hp].get_address(@address_id).body['floating_ip']['instance_id'].to_s
|
||||
end
|
||||
end
|
||||
|
||||
tests("#disassociate_address('#{@server.id}', '#{@ip_address}')").succeeds do
|
||||
|
@ -41,6 +49,10 @@ Shindo.tests('Fog::Compute[:hp] | address requests', ['hp']) do
|
|||
|
||||
tests('failure') do
|
||||
|
||||
tests("#get_address('invalidaddress', 'invalidip')").raises(Fog::Compute::HP::NotFound) do
|
||||
Fog::Compute[:hp].get_address('invalidaddress')
|
||||
end
|
||||
|
||||
tests("#associate_address('invalidserver', 'invalidip')").raises(Fog::Compute::HP::NotFound) do
|
||||
Fog::Compute[:hp].associate_address('invalidserver', 'invalidip')
|
||||
end
|
||||
|
@ -49,8 +61,8 @@ Shindo.tests('Fog::Compute[:hp] | address requests', ['hp']) do
|
|||
Fog::Compute[:hp].disassociate_address('invalidserver', 'invalidip')
|
||||
end
|
||||
|
||||
tests("#release_address('invalidip')").raises(Fog::Compute::HP::NotFound) do
|
||||
Fog::Compute[:hp].release_address('invalidip')
|
||||
tests("#release_address('invalidaddress')").raises(Fog::Compute::HP::NotFound) do
|
||||
Fog::Compute[:hp].release_address('invalidaddress')
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue