From a0649ba5fa1860798380dff2c215c093ae72e0bc Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sun, 5 May 2024 08:03:26 -0700 Subject: [PATCH] fixed sendchat test --- tests/test_sendchat.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_sendchat.py b/tests/test_sendchat.py index 460525155..9ee484724 100644 --- a/tests/test_sendchat.py +++ b/tests/test_sendchat.py @@ -15,11 +15,14 @@ class TestSendChat(unittest.TestCase): @patch("litellm.completion") @patch("builtins.print") def test_send_with_retries_rate_limit_error(self, mock_print, mock_completion): + mock = MagicMock() + mock.status_code = 500 + # Set up the mock to raise mock_completion.side_effect = [ openai.RateLimitError( "rate limit exceeded", - response=MagicMock(), + response=mock, body=None, ), None,