#!/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")