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

32 lines
766 B
Python

from __future__ import annotations
from pathlib import Path
import pytest
from sync_state_machine.config.run_presets import load_overrides_from_file
def test_load_overrides_from_yaml_file(tmp_path: Path) -> None:
pytest.importorskip("yaml")
yaml_file = tmp_path / "profile.yaml"
yaml_file.write_text(
"""
node_types:
- company
logging:
initialize: true
suppress_node_logs: true
local_datasource:
type: jsonl
jsonl_dir: ${PROJECT_ROOT}/filtered_datasource/datasource/filtered
""".strip(),
encoding="utf-8",
)
overrides = load_overrides_from_file(yaml_file, project_root=tmp_path)
assert overrides["logging"]["suppress_node_logs"] is True
assert str(tmp_path) in overrides["local_datasource"]["jsonl_dir"]