test(llm): cover wordlist-mode abort when no wordlist picked

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Justin Bollinger
2026-07-24 12:10:39 -04:00
co-authored by Claude Opus 4.8
parent a4da571ab4
commit bcea02b2e7
+8
View File
@@ -386,3 +386,11 @@ class TestOllamaAttack:
with patch("builtins.input", side_effect=["9"]):
ollama_attack(ctx)
ctx.hcatOllama.assert_not_called()
def test_wordlist_mode_aborts_when_no_wordlist_picked(self) -> None:
ctx = _make_ctx()
# mode "2", then an invalid picker selection -> picker returns None
ctx.list_wordlist_files.return_value = []
with patch("builtins.input", side_effect=["2", "nonsense"]):
ollama_attack(ctx)
ctx.hcatOllama.assert_not_called()