Implement AXIS parity UI and execution baseline
This commit is contained in:
35
scripts/test_react_frontend_m1.py
Normal file
35
scripts/test_react_frontend_m1.py
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Contract test for React FE-M1 build evidence."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import hashlib
|
||||
import json
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
|
||||
import generate_react_frontend_m1
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
REPORT = ROOT / "coverage/react-frontend-m1.report.json"
|
||||
|
||||
|
||||
class ReactFrontendM1Tests(unittest.TestCase):
|
||||
def test_contract(self) -> None:
|
||||
report = json.loads(REPORT.read_text(encoding="utf-8"))
|
||||
self.assertEqual(report["schema"], "react-frontend-m1-report.v1")
|
||||
self.assertEqual(report["status"], "verified")
|
||||
self.assertEqual(report["implementation_status"], "verified")
|
||||
self.assertEqual(report["checks"]["worker_authority"]["status"], "verified")
|
||||
self.assertEqual(report["checks"]["opfs_boundary"]["status"], "verified")
|
||||
self.assertEqual(report["checks"]["three_viewer"]["status"], "verified")
|
||||
|
||||
def test_self_hash(self) -> None:
|
||||
report = json.loads(REPORT.read_text(encoding="utf-8"))
|
||||
unsigned = {key: value for key, value in report.items() if key != "report_sha256"}
|
||||
self.assertEqual(report["report_sha256"], hashlib.sha256(generate_react_frontend_m1.canonical(unsigned).encode()).hexdigest())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user