Skip to content

Commit

Permalink
test: Generalise Empty Synth test
Browse files Browse the repository at this point in the history
There isn't a strong need to test a full json payload. This avoids issues when
the cdktf version changes
  • Loading branch information
techman83 committed Mar 18, 2024
1 parent 4c7295a commit a9ad28f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
4 changes: 3 additions & 1 deletion tests/stacks/test_cally.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
)
4 changes: 3 additions & 1 deletion tests/stacks/test_idp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
)
16 changes: 3 additions & 13 deletions tests/testdata/cdk/empty_synth.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}

0 comments on commit a9ad28f

Please sign in to comment.