mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-21 21:04:59 +00:00
Refactor coder.get_tracked_files to coder.repo.get_tracked_files in test_coder.py and add test_get_commit_message_no_strip_unmatched_quotes in test_repo.py.
This commit is contained in:
parent
e9090f8d61
commit
1fcb090ff6
2 changed files with 23 additions and 24 deletions
|
@ -51,6 +51,25 @@ class TestRepo(unittest.TestCase):
|
|||
# Assert that the returned message is the expected one
|
||||
self.assertEqual(result, "a good commit message")
|
||||
|
||||
@patch("aider.repo.send_with_retries")
|
||||
def test_get_commit_message_no_strip_unmatched_quotes(self, mock_send):
|
||||
# Set the return value of the mocked function
|
||||
mock_response = MagicMock()
|
||||
mock_response.choices = [MagicMock()]
|
||||
mock_response.choices[0].message.content = 'a good "commit message"'
|
||||
mock_send.return_value = (
|
||||
None,
|
||||
mock_response
|
||||
)
|
||||
|
||||
repo = AiderRepo(InputOutput(), None)
|
||||
# Call the get_commit_message method with dummy diff and context
|
||||
result = repo.get_commit_message("dummy diff", "dummy context")
|
||||
|
||||
# Assert that the returned message is the expected one
|
||||
self.assertEqual(result, 'a good "commit message"')
|
||||
|
||||
|
||||
def test_get_tracked_files(self):
|
||||
# Create a temporary directory
|
||||
tempdir = Path(tempfile.mkdtemp())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue