diff --git a/tests/test_env_resolution.py b/tests/test_env_resolution.py index b8086ca..ad6ff60 100644 --- a/tests/test_env_resolution.py +++ b/tests/test_env_resolution.py @@ -1,5 +1,7 @@ from pathlib import Path +import pytest + from src.coordinator import Coordinator from src.env_file_helper import DependencyRule, EnvFile, sort_env_files_by_rule @@ -22,6 +24,20 @@ def test_complex_sorting() -> None: assert sorted_env_files[0].env_type == "e" +def test_circular_import() -> None: + """This test will raise ValueError because the example input cannot be correctly ordered""" + demo_rules = [ + DependencyRule("a", "b"), + DependencyRule("b", "c"), + DependencyRule("c", "a"), + ] + + demo_types = ["a", "b", "c"] + env_files = [EnvFile(env_type=t, env_path=Path(), config=dict()) for t in demo_types] + with pytest.raises(ValueError): + sort_env_files_by_rule(env_files, demo_rules) + + def test_real_env_files() -> None: """authentik should be first"""