Skip to content

Commit

Permalink
fix: use os.path.join for cross-platform path handling in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-gauthier committed Oct 25, 2024
1 parent e3a3a55 commit bf60e58
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tests/basic/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ def test_cmd_read_only_from_working_dir(self):
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(
Expand All @@ -1047,10 +1047,8 @@ def test_cmd_read_only_from_working_dir(self):
)
)

# 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(
Expand Down

0 comments on commit bf60e58

Please sign in to comment.