Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

test: update simple URL test to use new normalize_url function

LearningCircuit5c9f510b0c70
diff --git a/tests/test_url_utils_simple.py b/tests/test_url_utils_simple.py
index 4da44c041b..913b844876 100644
--- a/tests/test_url_utils_simple.py
+++ b/tests/test_url_utils_simple.py
@@ -1,36 +1,36 @@
"""Simple test for URL utility functions without pytest."""
-from local_deep_research.utilities.url_utils import normalize_ollama_url
+from local_deep_research.utilities.url_utils import normalize_url
def test_url_normalization():
- """Test the normalize_ollama_url function."""
+ """Test the normalize_url function."""
# Test localhost without scheme
- assert normalize_ollama_url("localhost:11434") == "http://localhost:11434"
- assert normalize_ollama_url("127.0.0.1:11434") == "http://127.0.0.1:11434"
+ assert normalize_url("localhost:11434") == "http://localhost:11434"
+ assert normalize_url("127.0.0.1:11434") == "http://127.0.0.1:11434"
# Test external host without scheme
- assert normalize_ollama_url("example.com:11434") == "https://example.com:11434"
+ assert normalize_url("example.com:11434") == "https://example.com:11434"
# Test malformed URL with scheme
- assert normalize_ollama_url("http:localhost:11434") == "http://localhost:11434"
- assert (
- normalize_ollama_url("https:example.com:11434") == "https://example.com:11434"
- )
+ assert normalize_url("http:localhost:11434") == "http://localhost:11434"
+ assert normalize_url("https:example.com:11434") == "https://example.com:11434"
# Test well-formed URLs
- assert normalize_ollama_url("http://localhost:11434") == "http://localhost:11434"
- assert (
- normalize_ollama_url("https://example.com:11434") == "https://example.com:11434"
- )
+ assert normalize_url("http://localhost:11434") == "http://localhost:11434"
+ assert normalize_url("https://example.com:11434") == "https://example.com:11434"
# Test URLs with double slash prefix
- assert normalize_ollama_url("//localhost:11434") == "http://localhost:11434"
- assert normalize_ollama_url("//example.com:11434") == "https://example.com:11434"
-
- # Test empty URL
- assert normalize_ollama_url("") == "http://localhost:11434"
+ assert normalize_url("//localhost:11434") == "http://localhost:11434"
+ assert normalize_url("//example.com:11434") == "https://example.com:11434"
+
+ # Test empty URL (should raise ValueError)
+ try:
+ normalize_url("")
+ print("FAIL: Expected ValueError for empty URL")
+ except ValueError:
+ pass # Expected
print("All tests passed!")