2026-05-13 19:57:34 +09:00
|
|
|
"""Shared fixtures for integration tests.
|
|
|
|
|
|
2026-05-14 09:05:24 +09:00
|
|
|
Sets up the Python path so `import ont_platform.api.main` resolves the local
|
|
|
|
|
package and exposes helpers that turn
|
2026-05-13 19:57:34 +09:00
|
|
|
the FastAPI app into a controllable test harness.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
from __future__ import annotations
|
|
|
|
|
|
|
|
|
|
import sys
|
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
|
|
|
|
|
|
REPO_ROOT = Path(__file__).resolve().parents[2]
|
|
|
|
|
if str(REPO_ROOT) not in sys.path:
|
|
|
|
|
sys.path.insert(0, str(REPO_ROOT))
|
|
|
|
|
|
|
|
|
|
VENDORED_ONTOCAST = REPO_ROOT / "vendored" / "ontocast"
|
|
|
|
|
if str(VENDORED_ONTOCAST) not in sys.path:
|
|
|
|
|
sys.path.insert(0, str(VENDORED_ONTOCAST))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
|
def fixtures_dir() -> Path:
|
|
|
|
|
return REPO_ROOT / "tests" / "fixtures"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
|
def sample_json_path(fixtures_dir: Path) -> Path:
|
|
|
|
|
path = fixtures_dir / "sample_cryogenics.json"
|
|
|
|
|
assert path.exists(), f"Missing fixture: {path}"
|
|
|
|
|
return path
|