From 6146ea0189d8e040b366190035c60ce9e70f5194 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 9 Aug 2024 16:41:02 -0400 Subject: [PATCH] feat: Add test for --read option --- tests/basic/test_main.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/basic/test_main.py b/tests/basic/test_main.py index 0525fa8df..e4dc6b58e 100644 --- a/tests/basic/test_main.py +++ b/tests/basic/test_main.py @@ -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)