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:
parent
18c91aae5b
commit
946707a264
3 changed files with 26 additions and 9 deletions
|
@ -38,8 +38,10 @@ module Fog
|
||||||
case name
|
case name
|
||||||
when 'MaxItems'
|
when 'MaxItems'
|
||||||
@response[name] = value.to_i
|
@response[name] = value.to_i
|
||||||
when 'IsTruncated', 'NextRecordName', 'NextRecordType'
|
when 'NextRecordName', 'NextRecordType'
|
||||||
@response[name] = value
|
@response[name] = value
|
||||||
|
when 'IsTruncated'
|
||||||
|
@response[name] = value == 'true'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -224,17 +224,11 @@ Shindo.tests('Fog::DNS[:aws] | DNS requests', ['aws', 'dns']) do
|
||||||
response.status == 200
|
response.status == 200
|
||||||
}
|
}
|
||||||
|
|
||||||
test("list resource records") {
|
tests("list resource records").formats(AWS::DNS::Formats::LIST_RESOURCE_RECORD_SETS) {
|
||||||
pending if Fog.mocking?
|
pending if Fog.mocking?
|
||||||
|
|
||||||
# get resource records for zone
|
# get resource records for zone
|
||||||
response = @r53_connection.list_resource_record_sets( @zone_id)
|
@r53_connection.list_resource_record_sets(@zone_id).body
|
||||||
if response.status == 200
|
|
||||||
record_sets= response.body['ResourceRecordSets']
|
|
||||||
num_records= record_sets.count
|
|
||||||
end
|
|
||||||
|
|
||||||
response.status == 200
|
|
||||||
}
|
}
|
||||||
|
|
||||||
test("delete #{@new_records.count} resource records") {
|
test("delete #{@new_records.count} resource records") {
|
||||||
|
|
21
tests/aws/requests/dns/helper.rb
Normal file
21
tests/aws/requests/dns/helper.rb
Normal 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
|
Loading…
Add table
Reference in a new issue