test: add basic test for retry_exceptions function

This commit is contained in:
Paul Gauthier (aider) 2024-10-28 14:27:20 -07:00
parent bf63e7045b
commit 3d66b53791
2 changed files with 4 additions and 2 deletions

View file

@ -15,7 +15,6 @@ CACHE = None
RETRY_TIMEOUT = 60
#ai
def retry_exceptions():
import httpx

View file

@ -10,8 +10,11 @@ from aider.sendchat import simple_send_with_retries
class PrintCalled(Exception):
pass
#ai add a test that simply invokes retry_exceptions() and ensures no error raised!
class TestSendChat(unittest.TestCase):
def test_retry_exceptions(self):
"""Test that retry_exceptions() can be called without raising errors"""
from aider.sendchat import retry_exceptions
retry_exceptions() # Should not raise any exceptions
@patch("litellm.completion")
@patch("builtins.print")
def test_simple_send_with_retries_rate_limit_error(self, mock_print, mock_completion):