-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add PlatformTerraformManifestGenerator class
- Loading branch information
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
dbt_platform_helper/domain/test_terraform_manifest_generator.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from dbt_platform_helper.domain.terraform_environment import ( | ||
PlatformTerraformManifestGenerator, | ||
) | ||
|
||
|
||
class TestTerraformManifestGenerator: | ||
def test_generator_generates_expected_manifest_content_with_version_override(self): | ||
test_environment_config = { | ||
"vpc": "vpc3", | ||
"accounts": { | ||
"deploy": {"name": "non-prod-acc", "id": "1122334455"}, | ||
"dns": {"name": "non-prod-dns-acc", "id": "6677889900"}, | ||
}, | ||
"versions": {"terraform-platform-modules": 3}, | ||
} | ||
expected_header = "# WARNING: This is an autogenerated file, not for manual editing." | ||
expected_modules = "git::https://github.com/uktrade/terraform-platform-modules.git//extensions?depth=1&ref=123456" | ||
expected_moved_block = ( | ||
"moved {\n from = module.extensions-tf\n to = module.extensions\n}\n" | ||
) | ||
|
||
result = PlatformTerraformManifestGenerator().generate_manifest( | ||
"test-app", "test", test_environment_config, 123456 | ||
) | ||
|
||
assert expected_header in result | ||
assert expected_modules in result | ||
assert expected_moved_block in result |