From 993087f2bbf5a745c31e916d559c95efa2211fd9 Mon Sep 17 00:00:00 2001 From: Andrew Garrett Date: Mon, 29 Feb 2016 19:50:28 +0000 Subject: [PATCH] Fix AutoScalingGroup tags in DescribeAutoScalingGroups I'm not certain that this is the approach that's desired. It'd be nice to dynamically convert the keys one way or the other. Looking for feedback. Signed-off-by: Scott Greene --- moto/autoscaling/responses.py | 10 +++++----- .../test_cloudformation_stack_crud_boto3.py | 5 +++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/moto/autoscaling/responses.py b/moto/autoscaling/responses.py index d6fc7a12b..79cb6aeee 100644 --- a/moto/autoscaling/responses.py +++ b/moto/autoscaling/responses.py @@ -241,11 +241,11 @@ DESCRIBE_AUTOSCALING_GROUPS_TEMPLATE = """ {% for tag in group.tags %} - {{ tag.resource_type }} - {{ tag.resource_id }} - {{ tag.propagate_at_launch }} - {{ tag.key }} - {{ tag.value }} + {{ tag.resource_type or tag.ResourceType }} + {{ tag.resource_id or tag.ResourceId }} + {{ tag.propagate_at_launch or tag.PropagateAtLaunch }} + {{ tag.key or tag.Key }} + {{ tag.value or tag.Value }} {% endfor %} diff --git a/tests/test_cloudformation/test_cloudformation_stack_crud_boto3.py b/tests/test_cloudformation/test_cloudformation_stack_crud_boto3.py index d16a2d7b5..94d645a43 100644 --- a/tests/test_cloudformation/test_cloudformation_stack_crud_boto3.py +++ b/tests/test_cloudformation/test_cloudformation_stack_crud_boto3.py @@ -227,5 +227,6 @@ def test_stack_tags(): TemplateBody=dummy_template_json, Tags=tags, ) - - stack.tags.should.equal(tags) + observed_tag_items = set(item for items in [tag.items() for tag in stack.tags] for item in items) + expected_tag_items = set(item for items in [tag.items() for tag in tags] for item in items) + observed_tag_items.should.equal(expected_tag_items)