test(proxy): run the keyless deepgram refusal on a proxy with a master key

The test ran with no master key set, where the HTTP passthrough routes already accept a client without a key. A keyless WebSocket is now refused only when the proxy requires a key, so the test sets one
This commit is contained in:
L4XB 2026-10-22 14:14:14 +02:00
parent b2f931d6e0
commit 91aeff9300
No known key found for this signature in database

View file

@ -303,7 +303,12 @@ def test_deepgram_listen_rejects_connections_without_a_litellm_key():
relay = _FakeRelay()
client = TestClient(_app_with_relay(relay))
with patch(GET_CREDENTIALS, return_value="dg-provider-key") as get_credentials:
with (
patch(GET_CREDENTIALS, return_value="dg-provider-key") as get_credentials,
patch.multiple( # test-quality-ok: the real key auth path reads these proxy_server globals and has no injection seam
"litellm.proxy.proxy_server", master_key="sk-master", prisma_client=MagicMock()
),
):
with pytest.raises(WebSocketDisconnect) as disconnect:
with client.websocket_connect("/deepgram/v1/listen?model=nova-3"):
pass