summaryrefslogtreecommitdiffstats
path: root/tests/test_ollama_check_worker.py
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-05-05 10:51:56 +0200
committerDanilo M. <danix@danix.xyz>2026-05-05 10:51:56 +0200
commit54ad3e37c6e9d2242f932c192119dd6de64966cf (patch)
tree84c7018152825a63c2f6b009f18634a8585d996a /tests/test_ollama_check_worker.py
parent48b84da95d0736124f8be6849aa32df31bdb29aa (diff)
downloadpublisher-54ad3e37c6e9d2242f932c192119dd6de64966cf.tar.gz
publisher-54ad3e37c6e9d2242f932c192119dd6de64966cf.zip
feat: check OLLAMA_HOST reachability before starting translationv1.6
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 <noreply@anthropic.com>
Diffstat (limited to 'tests/test_ollama_check_worker.py')
-rw-r--r--tests/test_ollama_check_worker.py11
1 files changed, 11 insertions, 0 deletions
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"