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.

fix(tests): narrow broad status-code tautologies in test_api_routes.py (#4171)

LearningCircuit4cad9292260f
diff --git a/tests/web/routes/test_api_routes.py b/tests/web/routes/test_api_routes.py
index 1fc2117280..81d0aec54b 100644
--- a/tests/web/routes/test_api_routes.py
+++ b/tests/web/routes/test_api_routes.py
@@ -13,7 +13,7 @@ class TestGetCurrentConfig:
"""Should require authentication."""
response = client.get(f"{API_PREFIX}/settings/current-config")
# Should redirect to login or return 401
- assert response.status_code in [401, 302]
+ assert response.status_code == 401, response.status_code
def test_returns_config_when_authenticated(self, authenticated_client):
"""Should return config when authenticated."""
@@ -61,7 +61,7 @@ class TestApiStartResearch:
response = client.post(
f"{API_PREFIX}/start", json={"query": "test query", "mode": "quick"}
)
- assert response.status_code in [401, 302]
+ assert response.status_code == 401, response.status_code
def test_requires_query(self, authenticated_client):
"""Should require query parameter."""
@@ -136,7 +136,7 @@ class TestApiResearchStatus:
def test_requires_authentication(self, client):
"""Should require authentication."""
response = client.get(f"{API_PREFIX}/status/test-id")
- assert response.status_code in [401, 302]
+ assert response.status_code == 401, response.status_code
def test_returns_404_for_nonexistent(self, authenticated_client):
"""Should return 404 for non-existent research."""
@@ -200,7 +200,7 @@ class TestApiTerminateResearch:
def test_requires_authentication(self, client):
"""Should require authentication."""
response = client.post(f"{API_PREFIX}/terminate/test-id")
- assert response.status_code in [401, 302]
+ assert response.status_code == 401, response.status_code
def test_terminates_research(self, authenticated_client):
"""Should terminate research."""
@@ -239,7 +239,7 @@ class TestApiGetResources:
def test_requires_authentication(self, client):
"""Should require authentication."""
response = client.get(f"{API_PREFIX}/resources/test-id")
- assert response.status_code in [401, 302]
+ assert response.status_code == 401, response.status_code
def test_returns_resources(self, authenticated_client):
"""Should return resources for research."""
@@ -269,7 +269,7 @@ class TestApiAddResource:
f"{API_PREFIX}/resources/test-id",
json={"title": "Test", "url": "https://example.com"},
)
- assert response.status_code in [401, 302]
+ assert response.status_code == 401, response.status_code
def test_requires_title_and_url(self, authenticated_client):
"""Should require both title and URL."""
@@ -321,7 +321,7 @@ class TestApiDeleteResource:
def test_requires_authentication(self, client):
"""Should require authentication."""
response = client.delete(f"{API_PREFIX}/resources/test-id/delete/1")
- assert response.status_code in [401, 302]
+ assert response.status_code == 401, response.status_code
def test_deletes_resource(self, authenticated_client):
"""Should delete resource successfully."""
@@ -358,7 +358,7 @@ class TestCheckOllamaStatus:
def test_requires_authentication(self, client):
"""Should require authentication."""
response = client.get(f"{API_PREFIX}/check/ollama_status")
- assert response.status_code in [401, 302]
+ assert response.status_code == 401, response.status_code
def test_non_ollama_provider(self, authenticated_client, app):
"""Should return running=True for non-Ollama providers."""
@@ -426,7 +426,7 @@ class TestCheckOllamaModel:
def test_requires_authentication(self, client):
"""Should require authentication."""
response = client.get(f"{API_PREFIX}/check/ollama_model")
- assert response.status_code in [401, 302]
+ assert response.status_code == 401, response.status_code
def test_non_ollama_provider(self, authenticated_client, app):
"""Should return available=True for non-Ollama providers."""
@@ -495,7 +495,7 @@ class TestApiGetConfig:
def test_requires_authentication(self, client):
"""Should require authentication."""
response = client.get(f"{API_PREFIX}/config")
- assert response.status_code in [401, 302]
+ assert response.status_code == 401, response.status_code
def test_returns_public_config(self, authenticated_client, app):
"""Should return public configuration."""