diff --git a/tests/cli/test_tf.py b/tests/cli/test_tf.py index 9e90d8c..b0fc8e5 100644 --- a/tests/cli/test_tf.py +++ b/tests/cli/test_tf.py @@ -16,10 +16,12 @@ class TfTests(CallyTestHarness): def test_empty_print(self): result = CliRunner().invoke( tf, - ['print', '--service', 'test-cli', '--environment', 'test'], + ['print', '--service', 'test', '--environment', 'test'], obj=CallyConfig(config_file='blah.yaml'), ) self.assertEqual(result.exit_code, 0) + testdata = {"backend": {"local": {"path": "state/test.tfstate"}}} self.assertDictEqual( - json.loads(result.output), self.load_json_file('cli/empty_print.json') + json.loads(result.output).get('terraform'), + testdata, ) diff --git a/tests/stacks/test_cally.py b/tests/stacks/test_cally.py index 93a3ebe..c4c0382 100644 --- a/tests/stacks/test_cally.py +++ b/tests/stacks/test_cally.py @@ -8,4 +8,6 @@ class CallyStackTests(CallyTfTestHarness): def test_empty_synth(self): stack = CallyStack(service=self.empty_service) result = self.synth_stack(stack) - self.assertDictEqual(result, self.load_json_file('cdk/empty_synth.json')) + self.assertDictEqual( + result.get('terraform'), self.load_json_file('cdk/empty_synth.json') + ) diff --git a/tests/stacks/test_idp.py b/tests/stacks/test_idp.py index 3d5dc01..88a65f4 100644 --- a/tests/stacks/test_idp.py +++ b/tests/stacks/test_idp.py @@ -20,4 +20,6 @@ def test_class_load(self): def test_empty_synth(self): stack = stacks.MinimalStack(service=self.empty_service) result = self.synth_stack(stack) - self.assertDictEqual(result, self.load_json_file('cdk/empty_synth.json')) + self.assertDictEqual( + result.get('terraform'), self.load_json_file('cdk/empty_synth.json') + ) diff --git a/tests/testdata/cdk/empty_synth.json b/tests/testdata/cdk/empty_synth.json index 1276bfd..3fe1530 100644 --- a/tests/testdata/cdk/empty_synth.json +++ b/tests/testdata/cdk/empty_synth.json @@ -1,17 +1,7 @@ { - "//": { - "metadata": { - "backend": "local", - "stackName": "test", - "version": "0.20.4" - }, - "outputs": {} - }, - "terraform": { - "backend": { - "local": { - "path": "state/test.tfstate" - } + "backend": { + "local": { + "path": "state/test.tfstate" } } }