Advance simulation parity and 3-axis tutorial coverage

This commit is contained in:
2026-08-23 18:00:56 +08:00
parent 4a11d9692b
commit 938654b19d
107 changed files with 13537 additions and 3565 deletions

View File

@@ -0,0 +1,26 @@
#!/usr/bin/env python3
import hashlib
import json
import unittest
from pathlib import Path
import generate_axis3_tutorial_tool_io_report
ROOT = Path(__file__).resolve().parents[1]
REPORT = ROOT / "coverage/axis3-tutorial-tool-io.report.json"
class Axis3TutorialToolIoTests(unittest.TestCase):
def test_report(self) -> None:
report = json.loads(REPORT.read_text(encoding="utf-8"))
self.assertEqual(report["schema"], "axis3-tutorial-tool-io-report.v1")
self.assertEqual(report["task_id"], "TUTORIAL-11")
self.assertEqual(report["status"], "verified")
self.assertEqual(report["test"]["sample"]["probe"]["state"], "tripped")
self.assertTrue(report["test"]["sample"]["estop"]["recovered"])
unsigned = {key: value for key, value in report.items() if key != "report_sha256"}
self.assertEqual(report["report_sha256"], hashlib.sha256(generate_axis3_tutorial_tool_io_report.canonical(unsigned).encode()).hexdigest())
if __name__ == "__main__":
unittest.main()