From 9345e69bf4b8328422dff1d763fed9b6147682a0 Mon Sep 17 00:00:00 2001 From: Justin Bollinger Date: Thu, 19 Mar 2026 12:20:37 -0400 Subject: [PATCH] fix: ensure hashcat.induct exists before loopback test Hashcat renames ~/.hashcat/sessions/hashcat.induct after each session. When the directory is absent the loopback test fails with "No such file or directory". Recreate the directory in the test setup so it always exists when the loopback command runs. --- tests/test_hashcat_rules.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_hashcat_rules.py b/tests/test_hashcat_rules.py index 1a2636c..ebaa3a2 100644 --- a/tests/test_hashcat_rules.py +++ b/tests/test_hashcat_rules.py @@ -122,6 +122,10 @@ def test_toggle_rule_parses_with_and_without_loopback(tmp_path: Path, capsys): pytest.skip("hashcat not available in PATH") if not _hashcat_sessions_writable(): pytest.skip("hashcat session directory (~/.hashcat/sessions) is not writable") + # Hashcat renames hashcat.induct after each run; recreate so loopback can write. + (Path.home() / ".hashcat" / "sessions" / "hashcat.induct").mkdir( + parents=True, exist_ok=True + ) show_output = os.environ.get("HATE_CRACK_SHOW_HASHCAT_OUTPUT") == "1" show_cmd = (