release: Евномия, новая версия, линейка юристов
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
import importlib.util
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import board
|
||||
import core
|
||||
|
||||
|
||||
# Карточка под шапку фальшивого плана (SHAPKA тестов): shapka.py (T438) ставит суд, стороны и подпись из нее до Кони
|
||||
CARD = ("# Дело\n\n## Статус\n- **Суд:** Тестовый районный суд\n- **Номер дела:** —\n\n## Стороны\n"
|
||||
"- **Клиент (истец):** Тестовый Т.Т., адрес из фактов\n- **Оппонент (ответчик):** Ответный О.О.\n")
|
||||
|
||||
|
||||
def make_case(path: Path) -> Path:
|
||||
(path / "00_intake").mkdir(parents=True)
|
||||
(path / "_case.md").write_text("# Дело\n", encoding="utf-8")
|
||||
(path / "00_intake" / "01.md").write_text("Входной материал\n", encoding="utf-8")
|
||||
return path
|
||||
|
||||
|
||||
def only_run_dir(case: Path) -> Path:
|
||||
runs = [path for path in (case / ".agent" / "next").iterdir() if path.is_dir()]
|
||||
assert len(runs) == 1
|
||||
return runs[0]
|
||||
|
||||
|
||||
def events(run: core.Run) -> list[dict]:
|
||||
"""События прогона из events.jsonl."""
|
||||
return board.read_events(run.dir / "events.jsonl")
|
||||
|
||||
|
||||
def load_case_paths():
|
||||
"""Импортирует scripts/case_paths.py по пути: в тестах импорт из scripts/ разрешен."""
|
||||
scripts = str(core.ROOT / "scripts")
|
||||
sys.path.insert(0, scripts) # case_paths импортирует соседей по имени
|
||||
try:
|
||||
spec = importlib.util.spec_from_file_location("case_paths", core.ROOT / "scripts" / "case_paths.py")
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(module)
|
||||
finally:
|
||||
sys.path.remove(scripts)
|
||||
return module
|
||||
Reference in New Issue
Block a user