1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/tests/openstack/requests/compute/address_tests.rb
Alfonso Juan Dillera 62e73549e6 [openstack|compute] Add requests, models and tests for address
management

- Added tests to already existing requests.
- Modified the all method in the model as it doesn't have the server id
  when querying.
2012-04-30 10:34:58 +08:00

27 lines
918 B
Ruby

Shindo.tests('Fog::Compute[:openstack] | address requests', ['openstack']) do
@address_format = {
"instance_id" => NilClass,
"ip" => String,
"fixed_ip" => NilClass,
"id" => Integer,
"pool" => String
}
tests('success') do
tests('#allocate_address').formats({"floating_ip" => @address_format}) do
Fog::Compute[:openstack].allocate_address.body
end
tests('#list_all_addresses(server_id)').formats({"floating_ips" => [@address_format]}) do
Fog::Compute[:openstack].list_all_addresses("sd34234dvsdasdmlk123cdslfck1").body
end
tests('#get_address(address_id)').formats({"floating_ip" => @address_format}) do
Fog::Compute[:openstack].get_address(1).body
end
tests('#disassociate_address(server_id, ip_address)').succeeds do
Fog::Compute[:openstack].disassociate_address("sd34234dvsdasdmlk123cdslfck1", "192.168.27.129").body
end
end
end