From 80857d03c6af6200ee9a0d2e5e4010259040d6de Mon Sep 17 00:00:00 2001 From: Justin Bollinger Date: Fri, 13 Feb 2026 22:25:48 -0500 Subject: [PATCH] fix: add missing rulesDirectory mock in ollama 404 retry test The test built its own mock context instead of using the shared ollama_globals helper, missing the rulesDirectory and hcatPotfilePath patches. This caused FileNotFoundError on CI where /path/to/hashcat/rules doesn't exist. Co-Authored-By: Claude Opus 4.6 --- tests/test_pull_ollama_model.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_pull_ollama_model.py b/tests/test_pull_ollama_model.py index 4d3cb6e..54abe21 100644 --- a/tests/test_pull_ollama_model.py +++ b/tests/test_pull_ollama_model.py @@ -231,11 +231,15 @@ class TestHcatOllama404Retry: ] mock_pull.return_value = True + rules_dir = str(tmp_path / "rules") + os.makedirs(rules_dir, exist_ok=True) with mock.patch.object(hc_main, "ollamaUrl", self.OLLAMA_URL), \ mock.patch.object(hc_main, "ollamaModel", self.MODEL), \ mock.patch.object(hc_main, "hcatBin", "/usr/bin/hashcat"), \ mock.patch.object(hc_main, "hcatTuning", ""), \ + mock.patch.object(hc_main, "hcatPotfilePath", ""), \ mock.patch.object(hc_main, "hate_path", str(tmp_path)), \ + mock.patch.object(hc_main, "rulesDirectory", rules_dir), \ mock.patch("hate_crack.main.generate_session_id", return_value="test_session"), \ mock.patch("subprocess.Popen") as mock_popen: