mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-21 04:44:59 +00:00
Initialized Coder object with mocked IO and mocked repo, and updated coder.repo instead of coder.root.
This commit is contained in:
parent
0fc40df8e6
commit
4ac2143cc2
1 changed files with 4 additions and 4 deletions
|
@ -9,13 +9,13 @@ class TestCoder(unittest.TestCase):
|
|||
mock_io.get_input.return_value = "Please check file1.txt and file2.py"
|
||||
mock_io.confirm_ask.return_value = True
|
||||
|
||||
# Initialize the Coder object with the mocked IO and mocked repo
|
||||
coder = Coder(io=mock_io, openai_api_key="fake_key")
|
||||
|
||||
# Mock the git repo
|
||||
mock_repo = MagicMock()
|
||||
mock_repo.git.ls_files.return_value = "file1.txt\nfile2.py"
|
||||
|
||||
# Initialize the Coder object with the mocked IO and mocked repo
|
||||
coder = Coder(io=mock_io, openai_api_key="fake_key", repo=mock_repo)
|
||||
coder.root = "/path/to/repo"
|
||||
coder.repo = mock_repo
|
||||
|
||||
# Call the check_for_file_mentions method
|
||||
result = coder.check_for_file_mentions("Please check file1.txt and file2.py")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue