test: update fetch_api_models call-shape assertions for explicit timeout

Three tests pin the exact kwargs of the picker probe call
(test_model_switch_custom_providers + two in
test_user_providers_model_switch, the latter caught by CI slice 2);
the picker-timeout change now always passes timeout explicitly (5.0 on
the non-picker path), so the pinned shapes gain the key.
This commit is contained in:
kshitijk4poor 2026-08-02 22:01:42 +05:30 committed by kshitij
parent de0ce24c2e
commit 45c15d33e5
2 changed files with 3 additions and 3 deletions

View File

@ -640,7 +640,7 @@ def test_custom_providers_uses_live_models_for_multi_model_endpoint(monkeypatch)
assert gateway_prov is not None, "Custom provider group not found in results"
assert calls == [
("sk-gateway-key", "https://gateway.example.com/v1", {"headers": None})
("sk-gateway-key", "https://gateway.example.com/v1", {"timeout": 5.0, "headers": None})
], "fetch_api_models must be called with the custom provider's credentials"
assert gateway_prov["models"] == [
"gateway-model-a",

View File

@ -158,7 +158,7 @@ def test_list_authenticated_providers_uses_live_models_for_user_provider(monkeyp
)
assert user_prov is not None
assert calls == [("sk-test", "http://127.0.0.1:3000/api/v1", {"headers": None})]
assert calls == [("sk-test", "http://127.0.0.1:3000/api/v1", {"timeout": 5.0, "headers": None})]
assert user_prov["models"] == ["old-configured-model", "new-live-model"]
assert user_prov["total_models"] == 2
@ -497,7 +497,7 @@ def test_section3_probes_no_key_endpoint_without_explicit_models(monkeypatch):
assert probed.get("called") is True, "no-key bare endpoint should be probed"
assert probed["api_key"] == ""
assert probed["kwargs"] == {"headers": None}
assert probed["kwargs"] == {"timeout": 5.0, "headers": None}
row = next(p for p in providers if p["slug"] == "local-llamacpp")
assert row["models"] == ["live-model-1", "live-model-2", "live-model-3"]
assert row["total_models"] == 3