fix: update test to use os.path.samefile for path comparison

This commit is contained in:
Paul Gauthier (aider) 2024-10-29 13:45:03 -07:00
parent 56f3220d4c
commit ccdd333ba3

View file

@ -845,7 +845,12 @@ class TestCommands(TestCase):
read_only_files = {coder.get_rel_fname(f) for f in coder.abs_read_only_fnames}
self.assertEqual(added_files, {str(Path("internal1.txt"))})
self.assertEqual(read_only_files, {external_file1_path, external_file2_path})
self.assertTrue(
all(
any(os.path.samefile(external_path, fname) for fname in read_only_files)
for external_path in [external_file1_path, external_file2_path]
)
)
# Clean up
Path(session_file).unlink()