mirror of
https://github.com/trustedsec/hate_crack.git
synced 2026-07-28 14:47:22 -07:00
fix: tab completion on custom file-path prompts
The "p. Enter a custom path" branches of the OMEN and Markov training pickers, the combipow wordlist prompt, and the rule cleanup/optimize output-path prompts used a bare input() with no readline completer, so TAB did nothing. Route them through select_file_with_autocomplete. Also drop the path completer after each selection so later numeric-menu and y/n prompts don't inherit stale file-path tab completion. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
9db39be438
commit
a7233c2f4f
@@ -355,12 +355,14 @@ class TestOmenAttackHandler:
|
||||
def test_custom_path_for_training(self, tmp_path):
|
||||
ctx = self._make_ctx(tmp_path, model_valid=False)
|
||||
self._setup_rules_dir(tmp_path)
|
||||
ctx.select_file_with_autocomplete.return_value = "/custom/wordlist.txt"
|
||||
with patch("os.path.isfile", return_value=True), patch(
|
||||
"builtins.input", side_effect=["p", "/custom/wordlist.txt", "", "0"]
|
||||
"builtins.input", side_effect=["p", "", "0"]
|
||||
):
|
||||
from hate_crack.attacks import omen_attack
|
||||
|
||||
omen_attack(ctx)
|
||||
ctx.select_file_with_autocomplete.assert_called_once()
|
||||
ctx.hcatOmenTrain.assert_called_once_with("/custom/wordlist.txt")
|
||||
|
||||
def test_rules_passed_to_hcatOmen(self, tmp_path):
|
||||
|
||||
Reference in New Issue
Block a user