Implement AXIS parity UI and execution baseline
This commit is contained in:
27
scripts/test_native_oracle_closure_report.py
Normal file
27
scripts/test_native_oracle_closure_report.py
Normal file
@@ -0,0 +1,27 @@
|
||||
import hashlib
|
||||
import json
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
|
||||
import generate_native_oracle_closure_report
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
class NativeOracleClosureReportTests(unittest.TestCase):
|
||||
def test_report(self):
|
||||
report = json.loads((ROOT / "coverage/native-oracle-closure.report.json").read_text(encoding="utf-8"))
|
||||
self.assertEqual(report["schema"], "native-oracle-closure-report.v1")
|
||||
self.assertEqual(report["status"], "verified")
|
||||
self.assertTrue(report["runner"]["first_difference"] if "first_difference" in report["runner"] else True)
|
||||
|
||||
def test_report_self_hash(self):
|
||||
report = json.loads((ROOT / "coverage/native-oracle-closure.report.json").read_text(encoding="utf-8"))
|
||||
unsigned = dict(report)
|
||||
actual = unsigned.pop("report_sha256")
|
||||
self.assertEqual(actual, hashlib.sha256(generate_native_oracle_closure_report.canonical(unsigned).encode("utf-8")).hexdigest())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user