test: stub hashcat potfile-recovery call in non-interactive integration tests

The pre-dispatch 'check POT file' step in main() shells out to the real
hashcat binary, which is absent in CI, causing the four test_main_* tests
to fail with FileNotFoundError. Stub _run_hashcat_show in the shared
_run_main helper — these tests verify dispatch routing and prompt
suppression, not potfile recovery.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Justin Bollinger
2026-07-24 20:35:11 -04:00
co-authored by Claude
parent d6af30c3db
commit dde6f92d96
+4
View File
@@ -167,6 +167,10 @@ def test_dispatch_quick_multiple_rules_runs_each_as_separate_pass(tmp_path):
def _run_main(monkeypatch, argv):
monkeypatch.setattr(sys, "argv", ["hate_crack.py"] + argv)
# main()'s pre-dispatch potfile-recovery step shells out to the real hashcat
# binary, which is absent in CI. Stub it — these tests exercise dispatch
# routing and prompt suppression, not potfile recovery.
monkeypatch.setattr(hc_main, "_run_hashcat_show", lambda *a, **k: None)
with pytest.raises(SystemExit) as excinfo:
hc_main.main()
return excinfo.value.code