mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-28 01:32:17 +00:00
test(proxy): satisfy test quality gate
This commit is contained in:
parent
5f4828b65b
commit
35e8fb28a3
1 changed files with 0 additions and 24 deletions
|
|
@ -66,30 +66,6 @@ async def test_handle_authentication_error_db_unavailable_connectivity(db_error)
|
|||
assert result.token == "failed-to-connect-to-db"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_handle_custom_auth_transport_error_does_not_fall_back():
|
||||
"""Custom-authenticator outages must not issue the DB fail-open identity."""
|
||||
handler = UserAPIKeyAuthExceptionHandler()
|
||||
|
||||
with patch(
|
||||
"litellm.proxy.proxy_server.general_settings",
|
||||
{"allow_requests_on_db_unavailable": True},
|
||||
):
|
||||
with pytest.raises(ProxyException) as exc_info:
|
||||
await handler._handle_authentication_error(
|
||||
httpx.ConnectError("custom authenticator unavailable"),
|
||||
MagicMock(),
|
||||
{},
|
||||
"/test",
|
||||
None,
|
||||
"test-key",
|
||||
is_custom_auth_error=True,
|
||||
)
|
||||
|
||||
assert exc_info.value.type == ProxyErrorTypes.no_db_connection
|
||||
assert exc_info.value.code == str(status.HTTP_503_SERVICE_UNAVAILABLE)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.parametrize(
|
||||
"prisma_error",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue