mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 14:25:00 +00:00
fix: Use platform-independent path for read-only file test
This commit is contained in:
parent
8c3c050bf5
commit
68a78e4882
1 changed files with 4 additions and 3 deletions
|
@ -898,8 +898,9 @@ class TestCommands(TestCase):
|
||||||
test_file.write_text("Test content")
|
test_file.write_text("Test content")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Test the /read-only command with a path containing a tilde
|
# Test the /read-only command with a path in the user's home directory
|
||||||
commands.cmd_read_only("~/test_read_only_file.txt")
|
relative_path = os.path.join("~", "test_read_only_file.txt")
|
||||||
|
commands.cmd_read_only(relative_path)
|
||||||
|
|
||||||
# Check if the file was added to abs_read_only_fnames
|
# Check if the file was added to abs_read_only_fnames
|
||||||
self.assertTrue(
|
self.assertTrue(
|
||||||
|
@ -910,7 +911,7 @@ class TestCommands(TestCase):
|
||||||
)
|
)
|
||||||
|
|
||||||
# Test dropping the read-only file
|
# Test dropping the read-only file
|
||||||
commands.cmd_drop("~/test_read_only_file.txt")
|
commands.cmd_drop(relative_path)
|
||||||
|
|
||||||
# Check if the file was removed from abs_read_only_fnames
|
# Check if the file was removed from abs_read_only_fnames
|
||||||
self.assertEqual(len(coder.abs_read_only_fnames), 0)
|
self.assertEqual(len(coder.abs_read_only_fnames), 0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue