From bf60e58d5b0c0239b4c79173c3db59afc1ea36c6 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 25 Oct 2024 10:57:04 -0700 Subject: [PATCH] fix: use os.path.join for cross-platform path handling in tests --- tests/basic/test_commands.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/basic/test_commands.py b/tests/basic/test_commands.py index c430f86b4..40ae4fd5e 100644 --- a/tests/basic/test_commands.py +++ b/tests/basic/test_commands.py @@ -1037,7 +1037,7 @@ class TestCommands(TestCase): os.chdir(subdir) # Test the /read-only command using git_root referenced name - commands.cmd_read_only("subdir/test_read_only_file.txt") + commands.cmd_read_only(os.path.join("subdir", "test_read_only_file.txt")) # Check if the file was added to abs_read_only_fnames self.assertTrue( @@ -1047,10 +1047,8 @@ class TestCommands(TestCase): ) ) - # ai: these filenames use / so tests fail on windows; fix the one above and below to be portable! - # Test dropping the read-only file using git_root referenced name - commands.cmd_drop("subdir/test_read_only_file.txt") + commands.cmd_drop(os.path.join("subdir", "test_read_only_file.txt")) # Check if the file was removed from abs_read_only_fnames self.assertFalse(