From af8f7e95b09258ed3c9d69f2b50fcabc1f418ac7 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Tue, 4 Feb 2025 12:11:43 -0800 Subject: [PATCH] test: Mock `simple_send_with_retries` method in test setup --- tests/basic/test_history.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/basic/test_history.py b/tests/basic/test_history.py index b77869a8c..436bd4e3c 100644 --- a/tests/basic/test_history.py +++ b/tests/basic/test_history.py @@ -7,6 +7,7 @@ from aider.models import Model class TestChatSummary(TestCase): def setUp(self): self.mock_model = mock.Mock(spec=Model) + del self.mock_model.simple_send_with_retries self.mock_model.name = "gpt-3.5-turbo" self.mock_model.token_count = lambda msg: len(msg["content"].split()) self.mock_model.info = {"max_input_tokens": 4096} @@ -72,8 +73,10 @@ class TestChatSummary(TestCase): @mock.patch("aider.models.Model.simple_send_with_retries") def test_fallback_to_second_model(self, mock_send): mock_model1 = mock.Mock(spec=Model) + del mock_model1.simple_send_with_retries mock_model1.name = "gpt-4" mock_model2 = mock.Mock(spec=Model) + del mock_model2.simple_send_with_retries mock_model2.name = "gpt-3.5-turbo" chat_summary = ChatSummary([mock_model1, mock_model2], max_tokens=100)