test(fallback): classify authentication exception messages
This commit is contained in:
1 parent
18d1a325b6
commit
b321c63e1a
2 files changed
+16
-2
No files matched your search
@@ -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",
|
||||
[
|
||||
|
||||
Reference in new issue
Block a user