diff --git a/tests/test_env_resolution.py b/tests/test_env_resolution.py index b6ba802..87f6f7c 100644 --- a/tests/test_env_resolution.py +++ b/tests/test_env_resolution.py @@ -2,9 +2,12 @@ from pathlib import Path import pytest -# from abratest.env_file_helper import DependencyRule, EnvFile, sort_env_files_by_rule +from abratest.coordinator import Coordinator from abratest.env_manager import DependencyRule, EnvFile, EnvManager +RECIPES_DIR = Path("./recipes").resolve() +RUNNER_DICT = Coordinator.create_runner_dict(RECIPES_DIR) + def test_complex_sorting() -> None: demo_rules = [ # X depends on Y @@ -46,7 +49,7 @@ def test_real_env_files() -> None: Path("envfiles/login.test.dev.local-it.cloud.env"), # authentik ] env_files: list[EnvFile] = EnvManager._get_env_files(ENV_FILES) - dependency_rules: list[DependencyRule] = EnvManager._get_dependency_rules(env_files) + dependency_rules: list[DependencyRule] = EnvManager._get_dependency_rules(env_files, RUNNER_DICT) sorted_env_files = EnvManager.sort_env_files_by_rule(env_files, dependency_rules) assert sorted_env_files[0].env_type == "authentik" @@ -60,7 +63,7 @@ def test_real_env_files_duplicate() -> None: Path("envfiles/login.test.dev.local-it.cloud.env"), # authentik ] env_files: list[EnvFile] = EnvManager._get_env_files(ENV_FILES) - dependency_rules: list[DependencyRule] = EnvManager._get_dependency_rules(env_files) + dependency_rules: list[DependencyRule] = EnvManager._get_dependency_rules(env_files, RUNNER_DICT) sorted_env_files = EnvManager.sort_env_files_by_rule(env_files, dependency_rules) assert sorted_env_files[0].env_type == "authentik" assert sorted_env_files[1].env_type == "authentik" @@ -79,7 +82,7 @@ def test_real_env_files_duplicate_six() -> None: Path("envfiles/blog.test.dev.local-it.cloud.env"), # wordpress ] env_files: list[EnvFile] = EnvManager._get_env_files(ENV_FILES) - dependency_rules: list[DependencyRule] = EnvManager._get_dependency_rules(env_files) + dependency_rules: list[DependencyRule] = EnvManager._get_dependency_rules(env_files, RUNNER_DICT) sorted_env_files = EnvManager.sort_env_files_by_rule(env_files, dependency_rules) assert sorted_env_files[0].env_type == "authentik" assert sorted_env_files[1].env_type == "authentik" @@ -95,7 +98,7 @@ def test_env_manager() -> None: Path("envfiles/login.test.dev.local-it.cloud.env"), # authentik Path("envfiles/login.test.dev.local-it.cloud.env"), # authentik ] - ENV = EnvManager(env_paths_list) + ENV = EnvManager(env_paths_list, RUNNER_DICT) assert ENV.env_files[0].env_type == "authentik" assert ENV.env_files[1].env_type == "authentik" assert ENV.env_files[2].env_type == "wordpress"