mirror of
https://github.com/trustedsec/hate_crack.git
synced 2026-03-12 21:23:05 -07:00
19 lines
514 B
Python
19 lines
514 B
Python
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
|