test_export.py 544 bytes
import json
from pathlib import Path
import pytest
from memri_schema.exporters import export_frontend_json
JSON_SCHEMA_PATH = Path(__file__).parent.parent / "generated" / "schema.json"
def test_generated_schema(tmp_path):
    assert JSON_SCHEMA_PATH.exists()
    tmp_schema_path = tmp_path / "schema.json"
    export_frontend_json(output_file=tmp_schema_path)
    with open(JSON_SCHEMA_PATH, "r") as f:
        schema = f.read()
    with open(tmp_schema_path, "r") as f:
        test_schema = f.read()
    assert schema == test_schema