mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
(test) proxy_custom_auth use new exceptions
This commit is contained in:
parent
d2675a1ff3
commit
b3ce0ac728
2 changed files with 7 additions and 6 deletions
|
@ -58,9 +58,10 @@ def test_custom_auth(client):
|
|||
|
||||
headers = {"Authorization": f"Bearer {token}"}
|
||||
response = client.post("/chat/completions", json=test_data, headers=headers)
|
||||
print(f"response: {response.text}")
|
||||
assert response.status_code == 401
|
||||
result = response.json()
|
||||
print(f"Received response: {result}")
|
||||
pytest.fail("LiteLLM Proxy test failed. This request should have been rejected")
|
||||
except Exception as e:
|
||||
pytest.fail("LiteLLM Proxy test failed. Exception", e)
|
||||
print(vars(e))
|
||||
print("got an exception")
|
||||
assert e.code == 401
|
||||
assert e.message == "Authentication Error, Failed custom auth"
|
||||
pass
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue