mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-21 12:55:00 +00:00
added test_get_files_content
This commit is contained in:
parent
f266c87e59
commit
1f64128978
1 changed files with 20 additions and 0 deletions
|
@ -48,6 +48,26 @@ class TestCoder(unittest.TestCase):
|
|||
)
|
||||
self.assertEqual(coder.abs_fnames, expected_files)
|
||||
|
||||
def test_get_files_content(self):
|
||||
tempdir = Path(tempfile.mkdtemp())
|
||||
|
||||
file1 = tempdir / "file1.txt"
|
||||
file2 = tempdir / "file2.txt"
|
||||
|
||||
file1.touch()
|
||||
file2.touch()
|
||||
|
||||
files = [file1, file2]
|
||||
|
||||
# Initialize the Coder object with the mocked IO and mocked repo
|
||||
coder = Coder.create(
|
||||
models.GPT4, None, io=InputOutput(), openai_api_key="fake_key", fnames=files
|
||||
)
|
||||
|
||||
content = coder.get_files_content().splitlines()
|
||||
self.assertIn("file1.txt", content)
|
||||
self.assertIn("file2.txt", content)
|
||||
|
||||
def test_check_for_filename_mentions_of_longer_paths(self):
|
||||
# Mock the IO object
|
||||
mock_io = MagicMock()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue