From 37dd1114f2e86699cad606131d86b616ffb2133e Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Tue, 23 Jan 2024 17:30:01 -0800 Subject: [PATCH] (test) update prisma test --- litellm/tests/test_key_generate_prisma.py | 30 +++++++++++------------ 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/litellm/tests/test_key_generate_prisma.py b/litellm/tests/test_key_generate_prisma.py index f50df457033..c62d41cca8f 100644 --- a/litellm/tests/test_key_generate_prisma.py +++ b/litellm/tests/test_key_generate_prisma.py @@ -136,8 +136,8 @@ def test_call_with_invalid_key(prisma_client): asyncio.run(test()) except Exception as e: print("Got Exception", e) - print(e.detail) - assert "Authentication Error" in e.detail + print(e.message) + assert "Authentication Error" in e.message pass @@ -171,7 +171,7 @@ def test_call_with_invalid_model(prisma_client): asyncio.run(test()) except Exception as e: assert ( - e.detail + e.message == "Authentication Error, API Key not allowed to access model. This token can only access models=['mistral']. Tried to access gemini-pro-vision" ) pass @@ -274,7 +274,7 @@ def test_call_with_user_over_budget(prisma_client): asyncio.run(test()) except Exception as e: - error_detail = e.detail + error_detail = e.message assert "Authentication Error, ExceededBudget:" in error_detail print(vars(e)) @@ -350,7 +350,7 @@ def test_call_with_user_over_budget_stream(prisma_client): asyncio.run(test()) except Exception as e: - error_detail = e.detail + error_detail = e.message assert "Authentication Error, ExceededBudget:" in error_detail print(vars(e)) @@ -414,8 +414,8 @@ def test_generate_and_call_with_expired_key(prisma_client): asyncio.run(test()) except Exception as e: print("Got Exception", e) - print(e.detail) - assert "Authentication Error" in e.detail + print(e.message) + assert "Authentication Error" in e.message pass @@ -486,8 +486,8 @@ def test_delete_key_auth(prisma_client): asyncio.run(test()) except Exception as e: print("Got Exception", e) - print(e.detail) - assert "Authentication Error" in e.detail + print(e.message) + assert "Authentication Error" in e.message pass @@ -599,7 +599,7 @@ def test_generate_and_update_key(prisma_client): asyncio.run(test()) except Exception as e: print("Got Exception", e) - print(e.detail) + print(e.message) pytest.fail(f"An exception occurred - {str(e)}") @@ -665,11 +665,11 @@ def test_key_generate_with_custom_auth(prisma_client): except Exception as e: # this should fail print("Got Exception", e) - print(e.detail) + print(e.message) print("First request failed!. This is expected") assert ( "This violates LiteLLM Proxy Rules. No team id provided." - in e.detail + in e.message ) request_2 = GenerateKeyRequest( @@ -683,7 +683,7 @@ def test_key_generate_with_custom_auth(prisma_client): asyncio.run(test()) except Exception as e: print("Got Exception", e) - print(e.detail) + print(e.message) pytest.fail(f"An exception occurred - {str(e)}") @@ -752,7 +752,7 @@ def test_call_with_key_over_budget(prisma_client): asyncio.run(test()) except Exception as e: - error_detail = e.detail + error_detail = e.message assert "Authentication Error, ExceededTokenBudget:" in error_detail print(vars(e)) @@ -827,6 +827,6 @@ def test_call_with_key_over_budget_stream(prisma_client): pytest.fail(f"This should have failed!. They key crossed it's budget") except Exception as e: - error_detail = e.detail + error_detail = e.message assert "Authentication Error, ExceededTokenBudget:" in error_detail print(vars(e))