weakpass tests and migration to api.py

This commit is contained in:
Justin Bollinger
2026-01-26 16:10:58 -05:00
parent 544ee2dba3
commit a46ea5897a
7 changed files with 367 additions and 630 deletions
+14
View File
@@ -0,0 +1,14 @@
import sys
import pytest
def test_cli_weakpass_exits(hc_module, monkeypatch, capsys):
hc = hc_module
monkeypatch.setattr(hc, "weakpass_wordlist_menu", lambda **kwargs: print("weakpass_wordlist_menu called"))
monkeypatch.setattr(sys, "argv", ["hate_crack.py", "--weakpass"])
with pytest.raises(SystemExit) as excinfo:
hc.main()
assert excinfo.value.code == 0
captured = capsys.readouterr()
assert "weakpass_wordlist_menu called" in captured.out