fixed sendchat test

This commit is contained in:
Paul Gauthier 2024-05-05 08:03:26 -07:00
parent 6f8c1cf780
commit a0649ba5fa

View file

@ -15,11 +15,14 @@ class TestSendChat(unittest.TestCase):
@patch("litellm.completion") @patch("litellm.completion")
@patch("builtins.print") @patch("builtins.print")
def test_send_with_retries_rate_limit_error(self, mock_print, mock_completion): 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 # Set up the mock to raise
mock_completion.side_effect = [ mock_completion.side_effect = [
openai.RateLimitError( openai.RateLimitError(
"rate limit exceeded", "rate limit exceeded",
response=MagicMock(), response=mock,
body=None, body=None,
), ),
None, None,