Files
phase-memory/tests/test_public_api.py

26 lines
999 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"]
release_note_template = Path(snapshot["compatibility"]["release_note_template"])
template_text = release_note_template.read_text(encoding="utf-8")
for heading in ("Changed Exports", "Changed Service Operations", "Migration Needs", "Operator Action"):
assert heading in template_text
def test_service_contract_catalog_matches_local_runner_supported_operations() -> None:
declared = set(service_contracts()["operations"])
assert set(LocalServiceRunner.supported_operations()) == declared