mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[ec2] convert availability zone specs to shindo
This commit is contained in:
parent
b26ad4f879
commit
ba1b0e41b6
4 changed files with 36 additions and 24 deletions
|
@ -1,23 +0,0 @@
|
||||||
require File.dirname(__FILE__) + '/../../../spec_helper'
|
|
||||||
|
|
||||||
describe 'EC2.describe_availability_zones' do
|
|
||||||
describe 'success' do
|
|
||||||
|
|
||||||
it "should return proper attributes with no params" do
|
|
||||||
actual = AWS[:ec2].describe_availability_zones
|
|
||||||
zone = actual.body['availabilityZoneInfo'].first
|
|
||||||
zone['regionName'].should be_a(String)
|
|
||||||
zone['zoneName'].should be_a(String)
|
|
||||||
zone['zoneState'].should be_a(String)
|
|
||||||
end
|
|
||||||
|
|
||||||
it "should return proper attribute with params" do
|
|
||||||
actual = AWS[:ec2].describe_availability_zones(['us-east-1a'])
|
|
||||||
zone = actual.body['availabilityZoneInfo'].first
|
|
||||||
zone['regionName'].should be_a(String)
|
|
||||||
zone['zoneName'].should be_a(String)
|
|
||||||
zone['zoneState'].should be_a(String)
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -41,6 +41,15 @@ module AWS
|
||||||
'requestId' => String
|
'requestId' => String
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AVAILABILITY_ZONES = {
|
||||||
|
'availabilityZoneInfo' => [{
|
||||||
|
'regionName' => String,
|
||||||
|
'zoneName' => String,
|
||||||
|
'zoneState' => String
|
||||||
|
}],
|
||||||
|
'requestId' => String
|
||||||
|
}
|
||||||
|
|
||||||
BASIC = {
|
BASIC = {
|
||||||
'requestId' => String,
|
'requestId' => String,
|
||||||
'return' => ::Fog::Boolean
|
'return' => ::Fog::Boolean
|
||||||
|
|
23
tests/aws/requests/ec2/availability_zone_tests.rb
Normal file
23
tests/aws/requests/ec2/availability_zone_tests.rb
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
Shindo.tests('AWS::EC2 | availability zone requests', ['aws']) do
|
||||||
|
|
||||||
|
tests('success') do
|
||||||
|
|
||||||
|
tests('#describe_availability_zones').formats(AWS::EC2::Formats::AVAILABILITY_ZONES) do
|
||||||
|
AWS[:ec2].describe_availability_zones.body
|
||||||
|
end
|
||||||
|
|
||||||
|
tests("#describe_availability_zones('us-east-1a')").formats(AWS::EC2::Formats::AVAILABILITY_ZONES) do
|
||||||
|
AWS[:ec2].describe_availability_zones('us-east-1a').body
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
tests('failure') do
|
||||||
|
|
||||||
|
tests("#describe_availability_zones('not-a-zone')").raises(Excon::Errors::BadRequest) do
|
||||||
|
AWS[:ec2].describe_availability_zones('not-a-zone')
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
|
@ -1,4 +1,5 @@
|
||||||
Shindo.tests('AWS::EC2 | region requests', ['aws']) do
|
Shindo.tests('AWS::EC2 | region requests', ['aws']) do
|
||||||
|
|
||||||
tests('success') do
|
tests('success') do
|
||||||
|
|
||||||
tests("#describe_regions").formats(AWS::EC2::Formats::REGIONS) do
|
tests("#describe_regions").formats(AWS::EC2::Formats::REGIONS) do
|
||||||
|
@ -10,10 +11,12 @@ Shindo.tests('AWS::EC2 | region requests', ['aws']) do
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
tests('failure') do
|
tests('failure') do
|
||||||
|
|
||||||
tests("#describe_regions('not-a-region')").raises(Excon::Errors::BadRequest) do
|
tests("#describe_regions('not-a-region')").raises(Excon::Errors::BadRequest) do
|
||||||
AWS[:ec2].describe_regions('not-a-region').body
|
AWS[:ec2].describe_regions('not-a-region')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue