mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-23 13:54:59 +00:00
Added test case for issue #139
This commit is contained in:
parent
47b550c62f
commit
9352bc67ca
1 changed files with 16 additions and 1 deletions
|
@ -84,7 +84,7 @@ class TestCommands(TestCase):
|
||||||
|
|
||||||
def test_cmd_add_drop_directory(self):
|
def test_cmd_add_drop_directory(self):
|
||||||
# Initialize the Commands and InputOutput objects
|
# Initialize the Commands and InputOutput objects
|
||||||
io = InputOutput(pretty=False, yes=True)
|
io = InputOutput(pretty=False, yes=False)
|
||||||
from aider.coders import Coder
|
from aider.coders import Coder
|
||||||
|
|
||||||
coder = Coder.create(models.GPT35, None, io)
|
coder = Coder.create(models.GPT35, None, io)
|
||||||
|
@ -112,6 +112,21 @@ class TestCommands(TestCase):
|
||||||
str(Path("test_dir/another_dir/test_file.txt").resolve()), coder.abs_fnames
|
str(Path("test_dir/another_dir/test_file.txt").resolve()), coder.abs_fnames
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Issue #139 /add problems when cwd != git_root
|
||||||
|
|
||||||
|
# remember the proper abs path to this file
|
||||||
|
abs_fname = str(Path("test_dir/another_dir/test_file.txt").resolve())
|
||||||
|
|
||||||
|
# chdir to someplace other than git_root
|
||||||
|
Path("side_dir").mkdir()
|
||||||
|
os.chdir("side_dir")
|
||||||
|
|
||||||
|
# add it via it's git_root referenced name
|
||||||
|
commands.cmd_add("test_dir/another_dir/test_file.txt")
|
||||||
|
|
||||||
|
# it should be there, but was not in v0.10.0
|
||||||
|
self.assertIn(abs_fname, coder.abs_fnames)
|
||||||
|
|
||||||
def test_cmd_drop_with_glob_patterns(self):
|
def test_cmd_drop_with_glob_patterns(self):
|
||||||
# Initialize the Commands and InputOutput objects
|
# Initialize the Commands and InputOutput objects
|
||||||
io = InputOutput(pretty=False, yes=True)
|
io = InputOutput(pretty=False, yes=True)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue