24 lines
773 B
Python
24 lines
773 B
Python
import json
|
|
from pathlib import Path
|
|
|
|
from app.validation import validate_claude_output, validate_report
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
|
|
|
|
def test_sample_report_is_valid():
|
|
payload = json.loads((ROOT / "examples" / "sample-report.json").read_text(encoding="utf-8"))
|
|
assert validate_report(payload) == []
|
|
|
|
|
|
def test_sample_claude_output_is_valid():
|
|
payload = json.loads((ROOT / "examples" / "sample-claude-output.json").read_text(encoding="utf-8"))
|
|
assert validate_claude_output(payload) == []
|
|
|
|
|
|
def test_unknown_design_property_is_rejected():
|
|
payload = json.loads((ROOT / "examples" / "sample-report.json").read_text(encoding="utf-8"))
|
|
payload["design"]["surprise_layout"] = True
|
|
errors = validate_report(payload)
|
|
assert errors
|