Files
ecm_sync_system/tests/integration/test_toolchain_config_and_graph.py
T
strepsiades 4a9c444b10 first commit
2026-03-09 16:31:42 +08:00

28 lines
787 B
Python

from __future__ import annotations
from pathlib import Path
from tools.render_graph import render_mermaid
from tools.validate_config import validate_config
ROOT = Path(__file__).resolve().parents[2]
CFG_PATH = ROOT / "sync_state_machine" / "config" / "node_state_machine.yaml"
def test_validate_config_has_no_errors() -> None:
problems, _cfg = validate_config(CFG_PATH)
errors = [p for p in problems if p.level == "ERROR"]
assert not errors
def test_render_mermaid_contains_core_edges() -> None:
problems, cfg = validate_config(CFG_PATH)
errors = [p for p in problems if p.level == "ERROR"]
assert not errors
mermaid = render_mermaid(cfg)
assert "flowchart LR" in mermaid
assert "S02 -- \"E16" in mermaid
assert "S06 -- \"E40" in mermaid