File size: 477 Bytes
eab734a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | """Shared test helpers (not pytest-plugin)."""
from __future__ import annotations
import json
from pathlib import Path
from statement_to_tikz.ir import GeometryIR
FIXTURES = Path(__file__).parent / "fixtures"
def load_fixture(name: str) -> tuple[GeometryIR, str]:
data = json.loads((FIXTURES / name).read_text(encoding="utf-8"))
expected = data.pop("expected_mode", "exact")
ir = GeometryIR.model_validate(data)
ir.ensure_labels()
return ir, expected
|