implement env manager #6

Merged
dan merged 28 commits from dependency-improvement into dev 2023-12-04 17:09:03 +01:00
Showing only changes of commit d40ae79991 - Show all commits

View file

@ -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"""