Record AXIS browser and parity test matrix

This commit is contained in:
2026-08-23 10:12:09 +08:00
parent c96c48a0eb
commit 00d97fc2d4
5 changed files with 216 additions and 1 deletions

View File

@@ -0,0 +1,35 @@
#!/usr/bin/env python3
"""Contract tests for AXIS-TEST-01..06 evidence."""
from __future__ import annotations
import hashlib
import json
import unittest
from pathlib import Path
import generate_axis_test_matrix_report
ROOT = Path(__file__).resolve().parents[1]
REPORT = ROOT / "coverage/axis-test-matrix.report.json"
class AxisTestMatrixReportTests(unittest.TestCase):
def test_contract(self) -> None:
report = json.loads(REPORT.read_text(encoding="utf-8"))
self.assertEqual(report["schema"], "axis-test-matrix-report.v1")
self.assertEqual(report["task_id"], "AXIS-TEST-01..06")
self.assertEqual(report["status"], "partial")
self.assertEqual(report["checks"]["dom_accessibility"]["status"], "verified")
self.assertEqual(report["checks"]["canonical_visual"]["status"], "verified")
self.assertEqual(report["checks"]["browser_minimum_matrix"]["status"], "blocked")
self.assertEqual(report["checks"]["opfs_recovery"]["status"], "blocked")
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_axis_test_matrix_report.canonical(unsigned).encode()).hexdigest())
if __name__ == "__main__":
unittest.main()