~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.
Python academiaanthropicarxivbravedeep-researchencryptionhome-automationhomeserverlocallocal-deep-researchlocal-llmmistralollamaopenaipubmedresearchresearch-toolretrieval-augmented-generationsearxngself-hosted
fix(tests): dynamically find settings for type-conversion tests (#3183)
LearningCircuit84448acd1af8
diff --git a/tests/web/routes/test_settings_routes.py b/tests/web/routes/test_settings_routes.pyindex 62f645e4e7..34c08acc27 100644--- a/tests/web/routes/test_settings_routes.py+++ b/tests/web/routes/test_settings_routes.py@@ -1,5 +1,6 @@"""Tests for settings_routes module - Settings API endpoints."""+import pytestfrom unittest.mock import patch, MagicMock, MockSETTINGS_PREFIX = "/settings"@@ -973,14 +974,39 @@ class TestCoerceSettingForWrite:class TestApiUpdateSettingTypeConversion:"""Integration tests: PUT /api/<key> round-trip type conversion."""+ @staticmethod+ def _find_editable_setting(authenticated_client, ui_element):+ """Find an editable setting with the given ui_element by scanning /api.++ Returns (key, original_data) or (None, None) if not found.+ Uses GET /settings/api to list all keys, then probes candidates+ via GET /settings/api/<key> to check ui_element and editable.+ """+ resp = authenticated_client.get(f"{SETTINGS_PREFIX}/api")+ assert resp.status_code == 200+ all_keys = list(resp.get_json().get("settings", {}).keys())++ for key in all_keys:+ detail_resp = authenticated_client.get(+ f"{SETTINGS_PREFIX}/api/{key}"+ )+ if detail_resp.status_code != 200:+ continue+ data = detail_resp.get_json()+ if (+ data.get("ui_element") == ui_element+ and data.get("editable") is True+ ):+ return key, data+ return None, None+def test_put_string_number_stored_as_int(self, authenticated_client):"""PUT string "999" for number setting -> GET returns int 999."""- # Use search.iterations — a number setting seeded from defaults- key = "search.iterations"- get_resp = authenticated_client.get(f"{SETTINGS_PREFIX}/api/{key}")- assert get_resp.status_code == 200- original = get_resp.get_json()- assert original["ui_element"] == "number"+ key, original = self._find_editable_setting(+ authenticated_client, "number"+ )+ if key is None:+ pytest.skip("No editable number setting found in test database")# PUT a string numberput_resp = authenticated_client.put(@@ -1006,12 +1032,11 @@ class TestApiUpdateSettingTypeConversion:def test_put_string_bool_stored_as_bool(self, authenticated_client):"""PUT string "true" for checkbox setting -> GET returns bool True."""- # Use app.enable_notifications — a checkbox setting seeded from defaults- key = "app.enable_notifications"- get_resp = authenticated_client.get(f"{SETTINGS_PREFIX}/api/{key}")- assert get_resp.status_code == 200- original = get_resp.get_json()- assert original["ui_element"] == "checkbox"+ key, original = self._find_editable_setting(+ authenticated_client, "checkbox"+ )+ if key is None:+ pytest.skip("No editable checkbox setting found in test database")# PUT string "true"put_resp = authenticated_client.put(