test(fallback): classify authentication exception messages

This commit is contained in:
KDB
2026-09-03 18:31:35 +08:00
committed by Xubin Ren
parent 18d1a325b6
commit b321c63e1a
2 changed files with 16 additions and 2 deletions
+13
View File
@@ -423,6 +423,19 @@ class TestFallbackWhenPrimaryRaises:
assert result.finish_reason == "stop"
factory.assert_called_once_with(_fallback("fallback-a"))
@pytest.mark.asyncio
async def test_authentication_exception_message_is_classified(self) -> None:
primary = _RaisingProvider("primary")
response, exception = await FallbackProvider._call_provider(
lambda provider, kwargs: provider.chat(**kwargs),
primary,
{},
)
assert exception is primary._exc
assert response.error_kind == "authentication"
@pytest.mark.parametrize(
"exc",
[