statement-to-tikz / tests /helpers.py
will702's picture
Upload folder using huggingface_hub
eab734a verified
Raw
History Blame Contribute Delete
477 Bytes
"""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