From bcea02b2e7d6fff4eb94bc633a7631f40f5b35ba Mon Sep 17 00:00:00 2001 From: Justin Bollinger Date: Fri, 24 Jul 2026 12:10:39 -0400 Subject: [PATCH] test(llm): cover wordlist-mode abort when no wordlist picked Co-Authored-By: Claude Opus 4.8 --- tests/test_attacks_behavior.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test_attacks_behavior.py b/tests/test_attacks_behavior.py index 3e7a5f2..2ce1bab 100644 --- a/tests/test_attacks_behavior.py +++ b/tests/test_attacks_behavior.py @@ -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()