mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-22 13:25:00 +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.get_input.return_value = "Please check file1.txt and file2.py"
|
||||||
mock_io.confirm_ask.return_value = True
|
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 the git repo
|
||||||
mock_repo = MagicMock()
|
mock_repo = MagicMock()
|
||||||
mock_repo.git.ls_files.return_value = "file1.txt\nfile2.py"
|
mock_repo.git.ls_files.return_value = "file1.txt\nfile2.py"
|
||||||
|
coder.repo = mock_repo
|
||||||
# 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"
|
|
||||||
|
|
||||||
# Call the check_for_file_mentions method
|
# Call the check_for_file_mentions method
|
||||||
result = coder.check_for_file_mentions("Please check file1.txt and file2.py")
|
result = coder.check_for_file_mentions("Please check file1.txt and file2.py")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue