add loadscript command

This commit is contained in:
Mark Wotton 2025-05-17 11:25:03 +07:00
parent 3caab85931
commit f42adbba48
2 changed files with 35 additions and 4 deletions

View file

@ -2106,6 +2106,17 @@ class TestCommands(TestCase):
"Command '/model gpt-4' is only supported in interactive mode, skipping."
)
def test_loadscript(self):
# Test that /loadscript can run shell that is interpreted as aider commands
# Create some test files
with open("test1.py", "w") as f:
f.write("print('test1')")
io = InputOutput(pretty=False, fancy_input=False, yes=True)
coder = Coder.create(self.GPT35, None, io)
commands = Commands(io, coder)
commands.cmd_loadscript("echo /add test1.py")
self.assertIn(str(Path("test1.py").resolve()), coder.abs_fnames)
def test_reset_after_coder_clone_preserves_original_read_only_files(self):
with GitTemporaryDirectory() as _:
repo_dir = str(".")