mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-20 20:35:00 +00:00
feat: add test for reading external file with --read option
This commit is contained in:
parent
27a1d9e60f
commit
da5ea3a767
1 changed files with 20 additions and 2 deletions
|
@ -410,3 +410,21 @@ class TestMain(TestCase):
|
|||
)
|
||||
|
||||
self.assertIn(str(Path(test_file).resolve()), coder.abs_read_only_fnames)
|
||||
|
||||
def test_read_option_with_external_file(self):
|
||||
with tempfile.NamedTemporaryFile(mode='w', delete=False) as external_file:
|
||||
external_file.write("External file content")
|
||||
external_file_path = external_file.name
|
||||
|
||||
try:
|
||||
with GitTemporaryDirectory():
|
||||
coder = main(
|
||||
["--read", external_file_path, "--exit", "--yes"],
|
||||
input=DummyInput(),
|
||||
output=DummyOutput(),
|
||||
return_coder=True,
|
||||
)
|
||||
|
||||
self.assertIn(external_file_path, coder.abs_read_only_fnames)
|
||||
finally:
|
||||
os.unlink(external_file_path)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue