mirror of
https://github.com/trustedsec/hate_crack.git
synced 2026-07-28 14:47:22 -07:00
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:
co-authored by
Claude
parent
d6af30c3db
commit
dde6f92d96
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user