add circular import test
This commit is contained in:
parent
dc0e568c04
commit
d40ae79991
1 changed files with 16 additions and 0 deletions
|
|
@ -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"""
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue