From 54ad3e37c6e9d2242f932c192119dd6de64966cf Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Tue, 5 May 2026 10:51:56 +0200 Subject: feat: check OLLAMA_HOST reachability before starting translation Non-blocking QThread check hits /api/tags on the resolved ollama host before launching TranslationWorker. Shows QMessageBox.warning() if unreachable; proceeds silently if reachable. Adds ollama_host field to Config with env-var fallback to http://localhost:11434. Co-Authored-By: Claude Sonnet 4.6 --- tests/test_ollama_check_worker.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tests/test_ollama_check_worker.py (limited to 'tests/test_ollama_check_worker.py') diff --git a/tests/test_ollama_check_worker.py b/tests/test_ollama_check_worker.py new file mode 100644 index 0000000..3c575db --- /dev/null +++ b/tests/test_ollama_check_worker.py @@ -0,0 +1,11 @@ +from workers.ollama_check_worker import OllamaCheckWorker + + +def test_worker_appends_api_tags_path(): + w = OllamaCheckWorker("http://localhost:11434") + assert w._url == "http://localhost:11434/api/tags" + + +def test_worker_strips_trailing_slash(): + w = OllamaCheckWorker("http://localhost:11434/") + assert w._url == "http://localhost:11434/api/tags" -- cgit v1.2.3