1
0
Fork 0
mirror of https://github.com/fog/fog-aws.git synced 2022-11-09 13:50:52 -05:00
fog--fog-aws/tests/models/compute/address_tests.rb
Eugene Howe 041d15fff3 subnet fixes
* need to return subnet id in instance mocks
* subnet -> network interfaces relationship
* move addresses to and from vpcs
* bump compute api version to 2016-11-15
* [mock] set dnsname for instance if the vpc is setup for it
2017-02-21 13:36:35 -05:00

43 lines
1,005 B
Ruby

Shindo.tests("Fog::Compute[:aws] | address", ['aws']) do
model_tests(Fog::Compute[:aws].addresses, {}, true) do
@server = Fog::Compute[:aws].servers.create
@server.wait_for { ready? }
tests('#server=').succeeds do
@instance.server = @server
end
tests('#server') do
test(' == @server') do
@server.reload
@instance.server.public_ip_address == @instance.public_ip
end
end
tests("#change_scope") do
test('to vpc') do
@instance.change_scope
@instance.domain == 'vpc'
end
test('to classic') do
@instance.change_scope
@instance.domain == 'standard'
end
# merge_attributes requires this
@instance = Fog::Compute[:aws].addresses.get(@instance.identity)
end
@server.destroy
end
model_tests(Fog::Compute[:aws].addresses, { :domain => "vpc" }, true) do
tests("#change_scope").raises(Fog::Compute::AWS::Error) do
@instance.change_scope
end
end
end