q63: spark/verify_result -- asserts to _check(), so -O cannot print VALID on a wrong title

This commit is contained in:
spark committed 2026-10-24 18:26:48 +00:00
1 parent 76224a63ca
commit 8a481dadbc
1 file changed
+9 -2
+9 -2
View File
@@ -1,7 +1,14 @@
#!/usr/bin/env python3
import json
def _check(cond, msg="check failed"):
"""Explicit failure path -- survives `python3 -O`, where `assert` is compiled away."""
if not cond:
raise SystemExit(f"FAIL: {msg}")
with open("/root/.hermes/wizard-outputs/spark/scrape_result.json") as f:
data = json.load(f)
assert data["title"] == "Example Domain", f"wrong title: {data['title']}"
assert data["status"] == "success", f"wrong status: {data['status']}"
_check(data["title"] == "Example Domain", f"wrong title: {data['title']}")
_check(data["status"] == "success", f"wrong status: {data['status']}")
print("VALID")