From bfe9feff0d382624687eb6fe7f523df1f9f047d1 Mon Sep 17 00:00:00 2001 From: Michael Barrett Date: Sat, 3 Feb 2018 10:55:39 -0800 Subject: [PATCH 1/2] Always dump the current output/result This fixes an issue that was introduced in #467. The original functionality was to always dump the current output to `.json-result`, that way it was easy to build & compare the output. With the current implementation (from #467) we raise an exception if the old results aren't available, but don't create the new results. This is an issue whenever creating a new test. --- stacker/blueprints/testutil.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stacker/blueprints/testutil.py b/stacker/blueprints/testutil.py index 0bc1c7cb8..d265abe5b 100644 --- a/stacker/blueprints/testutil.py +++ b/stacker/blueprints/testutil.py @@ -24,12 +24,12 @@ def assertRenderedBlueprint(self, blueprint): # noqa: N802 rendered_dict = blueprint.template.to_dict() rendered_text = json.dumps(rendered_dict, indent=4, sort_keys=True) + with open(expected_output + "-result", "w") as fd: + fd.write(rendered_text) + with open(expected_output) as fd: expected_dict = json.loads(fd.read()) expected_text = json.dumps(expected_dict, indent=4, sort_keys=True) - with open(expected_output + "-result", "w") as fd: - fd.write(rendered_text) - self.assertEquals(rendered_dict, expected_dict, diff(rendered_text, expected_text)) From 3bdc0601ee5154c80e6330510a90608c3d45afb0 Mon Sep 17 00:00:00 2001 From: Michael Barrett Date: Sun, 4 Feb 2018 10:08:15 -0800 Subject: [PATCH 2/2] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 536b77207..524f9f180 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## Upcoming/Master +- assertRenderedBlueprint always dumps current results [GH-528] ## 1.1.4 (2018-01-26)