You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
motief/tests/scripts/mindmodel/test_loader.py

21 lines
583 B

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")