2
0
Jelmer Vernooij 4 жил өмнө
parent
commit
e81948a3a8

+ 5 - 4
dulwich/tests/compat/test_repository.py

@@ -182,16 +182,17 @@ class WorkingTreeTestCase(ObjectStoreTestCase):
         worktrees = self._parse_worktree_list(output)
         self.assertEqual(len(worktrees), self._number_of_working_tree)
         self.assertEqual(worktrees[0][1], '(bare)')
-        self.assertEqual(os.path.normcase(worktrees[0][0]),
-                         os.path.normcase(self._mainworktree_repo.path))
+        self.assertTrue(
+            os.path.samefile(worktrees[0][0], self._mainworktree_repo.path))
 
         output = run_git_or_fail(
             ['worktree', 'list'], cwd=self._mainworktree_repo.path)
         worktrees = self._parse_worktree_list(output)
         self.assertEqual(len(worktrees), self._number_of_working_tree)
         self.assertEqual(worktrees[0][1], '(bare)')
-        self.assertEqual(os.path.normcase(worktrees[0][0]),
-                         os.path.normcase(self._mainworktree_repo.path))
+        self.assertTrue(os.path.samefile(
+            worktrees[0][0],
+            self._mainworktree_repo.path))
 
 
 class InitNewWorkingDirectoryTestCase(WorkingTreeTestCase):

+ 3 - 3
dulwich/tests/test_server.py

@@ -1020,9 +1020,9 @@ class FileSystemBackendTests(TestCase):
 
     def test_absolute(self):
         repo = self.backend.open_repository(self.path)
-        self.assertEqual(
-            os.path.normcase(os.path.abspath(repo.path)),
-            os.path.normcase(os.path.abspath(self.repo.path)))
+        self.assertTrue(os.path.samefile(
+            os.path.abspath(repo.path),
+            os.path.abspath(self.repo.path)))
 
     def test_child(self):
         self.assertRaises(