import json from pathlib import Path import runpy def test_certified_update_example(capsys): root=Path(__file__).resolve().parents[1] runpy.run_path(str(root/"examples/certified_update.py"),run_name="__main__") result=json.loads(capsys.readouterr().out) assert result["accepted"] assert result["audit"]["lower_gain_bound"]>0 assert result["confidence_attempts"]==1 def test_data_schema(): root=Path(__file__).resolve().parents[1] rows=[json.loads(s) for s in (root/"data/exact_match_prompts.jsonl").read_text().splitlines()] assert len(rows)==4 assert all(isinstance(x["prompt"],str) and isinstance(x["answer"],str) for x in rows)