feat(mindmodel): add manifest loader and tests

This commit is contained in:
2026-03-24 21:24:58 +01:00
parent 9c82962d47
commit 2efd7ba3a0
17 changed files with 806 additions and 122 deletions
+21
View File
@@ -0,0 +1,21 @@
import json
import pytest
from scripts.mindmodel import loader
def test_load_json_manifest(tmp_path):
data = [{"id": "c1", "description": "a constraint"}]
p = tmp_path / "manifest.json"
p.write_text(json.dumps(data), encoding="utf-8")
loaded = loader.load_manifest(str(p))
assert isinstance(loaded, dict)
assert "constraints" in loaded
assert any(c.get("id") == "c1" for c in loaded["constraints"])
def test_missing_manifest_raises():
with pytest.raises(loader.ManifestLoadError):
loader.load_manifest("nonexistent-file-manifest.json")