Files
troupe-standup/wizard-work/spark/verify_result.py
T

14 lines
482 B
Python

#!/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)
_check(data["title"] == "Example Domain", f"wrong title: {data['title']}")
_check(data["status"] == "success", f"wrong status: {data['status']}")
print("VALID")