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

@ -44,6 +44,7 @@ class EnvManager:
def _get_dependency_rules(env_files: list[EnvFile], RUNNER_DICT: dict[str, type["Runner"]]) -> list[DependencyRule]:
dependency_rules: list[DependencyRule] = []
for env_file in env_files:
assert env_file.env_type in RUNNER_DICT, f"no runner for env_type={env_file.env_type} found in RUNNER_DICT"
child_runner_class = RUNNER_DICT[env_file.env_type]
for dependency in child_runner_class.dependencies:
dependency_rule = DependencyRule(child=child_runner_class.env_type, dependency=dependency)