Implement AXIS parity UI and execution baseline
This commit is contained in:
29
scripts/test_o_word_runtime.py
Normal file
29
scripts/test_o_word_runtime.py
Normal file
@@ -0,0 +1,29 @@
|
||||
import hashlib
|
||||
import json
|
||||
import subprocess
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
|
||||
import generate_o_word_runtime_report
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
class OWordRuntimeTests(unittest.TestCase):
|
||||
def test_control_program(self):
|
||||
result = subprocess.run(["node", "web/worker/test_program_control.mjs"], cwd=ROOT, check=False)
|
||||
self.assertEqual(result.returncode, 0)
|
||||
|
||||
def test_report_self_hash(self):
|
||||
report = json.loads((ROOT / "coverage/o-word-runtime.report.json").read_text(encoding="utf-8"))
|
||||
self.assertEqual(report["schema"], "o-word-runtime-report.v1")
|
||||
self.assertEqual(report["status"], "verified")
|
||||
unsigned = dict(report)
|
||||
actual = unsigned.pop("report_sha256")
|
||||
self.assertEqual(actual, hashlib.sha256(generate_o_word_runtime_report.canonical(unsigned).encode("utf-8")).hexdigest())
|
||||
self.assertEqual(report["budgets"]["max_control_depth"], 32)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user