mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 14:25:00 +00:00
test: update test_sendchat to use Model class and fix assertion
This commit is contained in:
parent
a56fa567dd
commit
a74cdbfc28
1 changed files with 3 additions and 3 deletions
|
@ -3,6 +3,7 @@ from unittest.mock import MagicMock, patch
|
||||||
|
|
||||||
from aider.exceptions import LiteLLMExceptions
|
from aider.exceptions import LiteLLMExceptions
|
||||||
from aider.llm import litellm
|
from aider.llm import litellm
|
||||||
|
from aider.models import Model
|
||||||
from aider.sendchat import send_completion, simple_send_with_retries
|
from aider.sendchat import send_completion, simple_send_with_retries
|
||||||
|
|
||||||
|
|
||||||
|
@ -37,9 +38,8 @@ class TestSendChat(unittest.TestCase):
|
||||||
]
|
]
|
||||||
|
|
||||||
# Call the simple_send_with_retries method
|
# Call the simple_send_with_retries method
|
||||||
simple_send_with_retries(self.mock_model, self.mock_messages)
|
simple_send_with_retries(Model(self.mock_model), self.mock_messages)
|
||||||
# Should print: error message, description (if any), and retry message
|
assert mock_print.call_count == 3
|
||||||
assert mock_print.call_count == 2 # Error message + retry message
|
|
||||||
|
|
||||||
@patch("litellm.completion")
|
@patch("litellm.completion")
|
||||||
def test_send_completion_basic(self, mock_completion):
|
def test_send_completion_basic(self, mock_completion):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue