mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-28 21:49:40 +02:00
chore: ran linting
This commit is contained in:
parent
ceace003aa
commit
c7409c8995
48 changed files with 342 additions and 187 deletions
|
|
@ -37,4 +37,3 @@ def test_sanitize_messages_sets_tool_only_ai_content_to_none() -> None:
|
|||
|
||||
assert sanitized[0].content is None
|
||||
assert message.content == ""
|
||||
|
||||
|
|
|
|||
|
|
@ -77,7 +77,13 @@ async def test_resolve_billing_for_premium_global_config(monkeypatch):
|
|||
config,
|
||||
"GLOBAL_CONNECTIONS",
|
||||
[
|
||||
{"id": -101, "provider": "openai", "api_key": "sk-test", "base_url": None, "extra": {}},
|
||||
{
|
||||
"id": -101,
|
||||
"provider": "openai",
|
||||
"api_key": "sk-test",
|
||||
"base_url": None,
|
||||
"extra": {},
|
||||
},
|
||||
{
|
||||
"id": -102,
|
||||
"provider": "openrouter",
|
||||
|
|
@ -154,7 +160,15 @@ async def test_resolve_billing_falls_back_to_search_space_default(monkeypatch):
|
|||
monkeypatch.setattr(
|
||||
config,
|
||||
"GLOBAL_CONNECTIONS",
|
||||
[{"id": -101, "provider": "openai", "api_key": "sk-test", "base_url": None, "extra": {}}],
|
||||
[
|
||||
{
|
||||
"id": -101,
|
||||
"provider": "openai",
|
||||
"api_key": "sk-test",
|
||||
"base_url": None,
|
||||
"extra": {},
|
||||
}
|
||||
],
|
||||
raising=False,
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -120,7 +120,9 @@ def _set_global_llm_configs(monkeypatch, config, configs: list[dict]):
|
|||
"supports_chat": cfg.get("supports_chat", True),
|
||||
"supports_image_input": cfg.get("supports_image_input", True),
|
||||
"supports_tools": cfg.get("supports_tools", True),
|
||||
"supports_image_generation": cfg.get("supports_image_generation", False),
|
||||
"supports_image_generation": cfg.get(
|
||||
"supports_image_generation", False
|
||||
),
|
||||
"capabilities_override": cfg.get("capabilities_override") or {},
|
||||
"billing_tier": cfg.get("billing_tier", "free"),
|
||||
"catalog": {
|
||||
|
|
@ -157,7 +159,12 @@ async def test_auto_first_turn_pins_one_model(monkeypatch):
|
|||
monkeypatch,
|
||||
config,
|
||||
[
|
||||
{"id": -2, "litellm_provider": "openai", "model_name": "gpt-free", "api_key": "k1"},
|
||||
{
|
||||
"id": -2,
|
||||
"litellm_provider": "openai",
|
||||
"model_name": "gpt-free",
|
||||
"api_key": "k1",
|
||||
},
|
||||
{
|
||||
"id": -1,
|
||||
"litellm_provider": "openai",
|
||||
|
|
@ -548,7 +555,12 @@ async def test_explicit_user_model_change_clears_pin(monkeypatch):
|
|||
monkeypatch,
|
||||
config,
|
||||
[
|
||||
{"id": -2, "litellm_provider": "openai", "model_name": "gpt-free", "api_key": "k1"},
|
||||
{
|
||||
"id": -2,
|
||||
"litellm_provider": "openai",
|
||||
"model_name": "gpt-free",
|
||||
"api_key": "k1",
|
||||
},
|
||||
],
|
||||
)
|
||||
|
||||
|
|
@ -573,7 +585,12 @@ async def test_invalid_pinned_config_repairs_with_new_pin(monkeypatch):
|
|||
monkeypatch,
|
||||
config,
|
||||
[
|
||||
{"id": -2, "litellm_provider": "openai", "model_name": "gpt-free", "api_key": "k1"},
|
||||
{
|
||||
"id": -2,
|
||||
"litellm_provider": "openai",
|
||||
"model_name": "gpt-free",
|
||||
"api_key": "k1",
|
||||
},
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -135,7 +135,9 @@ async def test_generate_image_tool_global_sets_explicit_api_base():
|
|||
with (
|
||||
patch.object(gi_module, "shielded_async_session", return_value=session_cm),
|
||||
patch.object(gi_module, "_get_global_model", return_value=global_model),
|
||||
patch.object(gi_module, "_get_global_connection", return_value=global_connection),
|
||||
patch.object(
|
||||
gi_module, "_get_global_connection", return_value=global_connection
|
||||
),
|
||||
patch.object(
|
||||
gi_module, "aimage_generation", side_effect=fake_aimage_generation
|
||||
),
|
||||
|
|
|
|||
|
|
@ -288,4 +288,3 @@ def test_generate_image_gen_configs_assigns_image_id_offset():
|
|||
cfgs = _generate_image_gen_configs(raw, dict(_SETTINGS_BASE))
|
||||
assert all(c["id"] < -20_000 + 1 for c in cfgs)
|
||||
assert all(c["id"] > -29_000_000 for c in cfgs)
|
||||
|
||||
|
|
|
|||
|
|
@ -368,5 +368,3 @@ def test_register_continues_after_individual_failure(monkeypatch, caplog):
|
|||
|
||||
# The good config still registered.
|
||||
assert any("custom-deployment" in payload for payload in successful_calls)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -77,4 +77,3 @@ def test_stream_classifier_keeps_unknown_errors_generic() -> None:
|
|||
assert expected is False
|
||||
assert message == "Error during chat: database exploded"
|
||||
assert extra is None
|
||||
|
||||
|
|
|
|||
|
|
@ -59,4 +59,3 @@ def test_user_images_can_be_dropped_for_text_only_history() -> None:
|
|||
]
|
||||
|
||||
assert user_content_to_llm_content(content, allow_images=False) == "look"
|
||||
|
||||
|
|
|
|||
|
|
@ -65,4 +65,3 @@ def test_merge_does_not_duplicate_when_stream_already_has_text() -> None:
|
|||
final = [{"type": "text", "text": "final answer"}]
|
||||
|
||||
assert merge_streamed_and_final_parts(streamed, final) == streamed
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue