add missing key assertion in _get_dependency_rules and add test case

This commit is contained in:
Daniel 2023-12-14 10:44:08 +01:00
parent 88d466c745
commit 290b3f879a
2 changed files with 15 additions and 0 deletions

View file

@ -102,3 +102,17 @@ def test_env_manager() -> None:
assert ENV.env_files[0].env_type == "authentik"
assert ENV.env_files[1].env_type == "authentik"
assert ENV.env_files[2].env_type == "wordpress"
def test_RUNNER_DICT_missing_key() -> None:
"""RUNNER_DICT missing wordpress key while .env file with TYPE=wordpress given"""
env_paths_list = [
Path("envfiles/blog.test.dev.local-it.cloud.env"), # wordpress
Path("envfiles/login.test.dev.local-it.cloud.env"), # authentik
Path("envfiles/login.test.dev.local-it.cloud.env"), # authentik
]
RUNNER_DICT_COPY = RUNNER_DICT.copy()
del RUNNER_DICT_COPY["wordpress"]
with pytest.raises(AssertionError) as excinfo:
EnvManager(env_paths_list, RUNNER_DICT_COPY)
assert "no runner for" in str(excinfo.value)