From 9ef271fafa4d47a2161948a6679337af6c76f1d5 Mon Sep 17 00:00:00 2001 From: Koudai Aono Date: Thu, 25 Jan 2018 01:34:27 +0900 Subject: [PATCH 1/2] Remove unneeded comments --- .../test_cloudformation/test_cloudformation_stack_crud_boto3.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/test_cloudformation/test_cloudformation_stack_crud_boto3.py b/tests/test_cloudformation/test_cloudformation_stack_crud_boto3.py index 781e89e2b..b9ee60d6b 100644 --- a/tests/test_cloudformation/test_cloudformation_stack_crud_boto3.py +++ b/tests/test_cloudformation/test_cloudformation_stack_crud_boto3.py @@ -270,8 +270,6 @@ def test_create_stack_from_s3_url(): StackName='stack_from_url', TemplateURL=key_url, ) - # from IPython import embed - # embed() json.loads(json.dumps(cf_conn.get_template(StackName="stack_from_url")[ 'TemplateBody'])).should.equal(dummy_template) From 0eb02613a022ac25a331513974d25d47383e2abb Mon Sep 17 00:00:00 2001 From: Koudai Aono Date: Thu, 25 Jan 2018 02:37:51 +0900 Subject: [PATCH 2/2] fix get_template tests to support OrderedDict --- .../test_cloudformation_stack_crud_boto3.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/test_cloudformation/test_cloudformation_stack_crud_boto3.py b/tests/test_cloudformation/test_cloudformation_stack_crud_boto3.py index b9ee60d6b..e4625fe69 100644 --- a/tests/test_cloudformation/test_cloudformation_stack_crud_boto3.py +++ b/tests/test_cloudformation/test_cloudformation_stack_crud_boto3.py @@ -1,6 +1,7 @@ from __future__ import unicode_literals import json +from collections import OrderedDict import boto3 from botocore.exceptions import ClientError @@ -160,8 +161,8 @@ def test_boto3_create_stack(): TemplateBody=dummy_template_json, ) - json.loads(json.dumps(cf_conn.get_template(StackName="test_stack")['TemplateBody'])).should.equal( - dummy_template) + cf_conn.get_template(StackName="test_stack")['TemplateBody'].should.equal( + json.loads(dummy_template_json, object_pairs_hook=OrderedDict)) @mock_cloudformation @@ -270,8 +271,8 @@ def test_create_stack_from_s3_url(): StackName='stack_from_url', TemplateURL=key_url, ) - json.loads(json.dumps(cf_conn.get_template(StackName="stack_from_url")[ - 'TemplateBody'])).should.equal(dummy_template) + cf_conn.get_template(StackName="stack_from_url")['TemplateBody'].should.equal( + json.loads(dummy_template_json, object_pairs_hook=OrderedDict)) @mock_cloudformation @@ -305,8 +306,8 @@ def test_update_stack_from_s3_url(): TemplateURL=key_url, ) - json.loads(json.dumps(cf_conn.get_template(StackName="update_stack_from_url")[ - 'TemplateBody'])).should.equal(dummy_update_template) + cf_conn.get_template(StackName="update_stack_from_url")[ 'TemplateBody'].should.equal( + json.loads(dummy_update_template_json, object_pairs_hook=OrderedDict)) @mock_cloudformation