Refactor test_get_commit_message to use the correct import and handle the return value of mock_send correctly.

This commit is contained in:
Paul Gauthier 2023-07-21 14:27:31 -03:00
parent 6f3b498228
commit a789de9433

View file

@ -15,10 +15,13 @@ from tests.utils import GitTemporaryDirectory
class TestRepo(unittest.TestCase):
@patch("aider.sendchat.send_with_retries")
@patch("aider.repo.send_with_retries")
def test_get_commit_message(self, mock_send):
# Set the return value of the mocked function
mock_send.return_value = "a good commit message"
mock_send.return_value = (
None,
"a good commit message"
)
repo = AiderRepo(InputOutput(), None)
# Call the get_commit_message method with dummy diff and context