Files
phase-memory/tests/test_public_api.py

22 lines
696 B
Python

import json
from pathlib import Path
import phase_memory
from phase_memory.service import LocalServiceRunner, SERVICE_OPERATIONS, service_contracts
FIXTURES = Path(__file__).parent / "fixtures"
def test_public_api_snapshot_is_explicit() -> None:
snapshot = json.loads((FIXTURES / "public-api-snapshot.json").read_text(encoding="utf-8"))
assert sorted(phase_memory.__all__) == snapshot["exports"]
assert sorted(SERVICE_OPERATIONS) == snapshot["service_operations"]
def test_service_contract_catalog_matches_local_runner_supported_operations() -> None:
declared = set(service_contracts()["operations"])
assert set(LocalServiceRunner.supported_operations()) == declared