Skip to content

Commit

Permalink
Add tests for template tiers
Browse files Browse the repository at this point in the history
  • Loading branch information
JimMadge committed Jan 9, 2025
1 parent ef05a6c commit f995e01
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/config/test_sre_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,23 @@ def test_template_validation(self) -> None:
with pytest.raises(DataSafeHavenTypeError):
SREConfig.from_yaml(config.to_yaml())

@pytest.mark.parametrize(
"tier,allow_internet,copy,paste,packages",
[
(0, True, True, True, SoftwarePackageCategory.ANY),
(1, True, True, True, SoftwarePackageCategory.ANY),
(2, False, False, False, SoftwarePackageCategory.ANY),
(3, False, False, False, SoftwarePackageCategory.PRE_APPROVED),
(4, False, False, False, SoftwarePackageCategory.NONE),
]
)
def test_template_tiers(self, tier, allow_internet, copy, paste, packages):
config = SREConfig.template(tier=tier)
assert config.sre.allow_workspace_internet == allow_internet
assert config.sre.remote_desktop.allow_copy == copy
assert config.sre.remote_desktop.allow_paste == paste
assert config.sre.software_packages == packages

def test_from_yaml(self, sre_config, sre_config_yaml) -> None:
config = SREConfig.from_yaml(sre_config_yaml)
assert config == sre_config
Expand Down

0 comments on commit f995e01

Please sign in to comment.