feat: Add test for --read option

This commit is contained in:
Paul Gauthier (aider) 2024-08-09 16:41:02 -04:00
parent 1557bb0c00
commit 6146ea0189

View file

@ -396,3 +396,17 @@ class TestMain(TestCase):
output=DummyOutput(),
)
MockRepoMap.assert_called_once()
def test_read_option(self):
with GitTemporaryDirectory():
test_file = "test_file.txt"
Path(test_file).touch()
coder = main(
["--read", test_file, "--exit", "--yes"],
input=DummyInput(),
output=DummyOutput(),
return_coder=True,
)
self.assertIn(str(Path(test_file).resolve()), coder.abs_read_only_fnames)