1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[aws|dns] Parse IsTruncated as boolean in list_resource_record_set

Test for proper response format.
This commit is contained in:
Aaron Suggs 2012-03-08 16:36:58 -05:00
parent 18c91aae5b
commit 946707a264
3 changed files with 26 additions and 9 deletions

View file

@ -38,8 +38,10 @@ module Fog
case name
when 'MaxItems'
@response[name] = value.to_i
when 'IsTruncated', 'NextRecordName', 'NextRecordType'
when 'NextRecordName', 'NextRecordType'
@response[name] = value
when 'IsTruncated'
@response[name] = value == 'true'
end
end
end

View file

@ -224,17 +224,11 @@ Shindo.tests('Fog::DNS[:aws] | DNS requests', ['aws', 'dns']) do
response.status == 200
}
test("list resource records") {
tests("list resource records").formats(AWS::DNS::Formats::LIST_RESOURCE_RECORD_SETS) {
pending if Fog.mocking?
# get resource records for zone
response = @r53_connection.list_resource_record_sets( @zone_id)
if response.status == 200
record_sets= response.body['ResourceRecordSets']
num_records= record_sets.count
end
response.status == 200
@r53_connection.list_resource_record_sets(@zone_id).body
}
test("delete #{@new_records.count} resource records") {

View file

@ -0,0 +1,21 @@
class AWS
module DNS
module Formats
RESOURCE_RECORD_SET = {
"ResourceRecords" => Array,
"Name" => String,
"Type" => String,
"AliasTarget"=> Fog::Nullable::Hash,
"TTL" => Fog::Nullable::String
}
LIST_RESOURCE_RECORD_SETS = {
"ResourceRecordSets" => [RESOURCE_RECORD_SET],
"IsTruncated" => Fog::Boolean,
"MaxItems" => Integer,
"NextRecordName" => Fog::Nullable::String,
"NextRecordType" => Fog::Nullable::String
}
end
end
end