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

Implement test for ELBV2 describe_tags

This commit is contained in:
KevinLoiseau 2020-01-13 15:02:20 +01:00
parent d340b683a6
commit 413f0a2dc8
No known key found for this signature in database
GPG key ID: 709159A779B96CC3
2 changed files with 44 additions and 0 deletions

View file

@ -0,0 +1,35 @@
require 'fog/xml'
require 'fog/aws/parsers/elbv2/describe_tags'
DESCRIBE_TAGS_RESULT = <<-EOF
<DescribeTagsResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2015-12-01/">
<DescribeTagsResult>
<TagDescriptions>
<member>
<ResourceArn>arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188</ResourceArn>
<Tags>
<member>
<Value>lima</Value>
<Key>project</Key>
</member>
<member>
<Value>digital-media</Value>
<Key>department</Key>
</member>
</Tags>
</member>
</TagDescriptions>
</DescribeTagsResult>
<ResponseMetadata>
<RequestId>34f144db-f2d9-11e5-a53c-67205c0d10fd</RequestId>
</ResponseMetadata>
</DescribeTagsResponse>
EOF
Shindo.tests('AWS::ELBV2 | parsers | describe_tags', %w[aws elb parser]) do
tests('parses the xml').formats(AWS::ELBV2::Formats::DESCRIBE_TAGS) do
parser = Nokogiri::XML::SAX::Parser.new(Fog::Parsers::AWS::ELBV2::DescribeTags.new)
parser.parse(DESCRIBE_TAGS_RESULT)
parser.document.response
end
end

View file

@ -52,6 +52,15 @@ class AWS
DESCRIBE_LISTENERS = BASIC.merge({
'DescribeListenersResult' => {'Listeners' => [LISTENER], 'NextMarker' => Fog::Nullable::String}
})
TAG_DESCRIPTIONS = [{
"Tags" => Hash,
"ResourceArn" => String
}]
DESCRIBE_TAGS = BASIC.merge({
'DescribeTagsResult' => {'TagDescriptions' => TAG_DESCRIPTIONS}
})
end
end
end