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/requests/compute/region_tests.rb
Josh Lane d48d376e9c initial import
* take the liberty of correcting Aws naming
2014-12-31 09:17:51 -08:00

52 lines
1.7 KiB
Ruby

Shindo.tests('Fog::Compute[:aws] | region requests', ['aws']) do
@regions_format = {
'regionInfo' => [{
'regionEndpoint' => String,
'regionName' => String
}],
'requestId' => String
}
tests('success') do
tests("#describe_regions").formats(@regions_format) do
Fog::Compute[:aws].describe_regions.body
end
tests("#describe_regions('region-name' => 'us-east-1')").formats(@regions_format) do
Fog::Compute[:aws].describe_regions('region-name' => 'us-east-1').body
end
tests("#incorrect_region") do
raises(ArgumentError, "Unknown region: world-antarctica-1") do
Fog::Compute::AWS.new({:aws_access_key_id => 'dummykey',
:aws_secret_access_key => 'dummysecret',
:aws_session_token => 'dummytoken',
:region => 'world-antarctica-1'})
end
end
tests("#unknown_endpoint").formats(@regions_format) do
Fog::Compute::AWS.new({:aws_access_key_id => 'dummykey',
:aws_secret_access_key => 'dummysecret',
:aws_session_token => 'dummytoken',
:region => 'world-antarctica-1',
:endpoint => 'http://aws-clone.example'}).describe_regions.body
end
tests("#invalid_endpoint") do
raises(Fog::Compute::AWS::InvalidURIError) do
Fog::Compute::AWS.new({:aws_access_key_id => 'dummykey',
:aws_secret_access_key => 'dummysecret',
:aws_session_token => 'dummytoken',
:region => 'world-antarctica-1',
:endpoint => 'aws-clone.example'})
end
end
end
end