test_project: use os.readlink instead of Path.readlink

Path.readlink is only available on Python 3.9, breaking compatibility
with all python versions below. os.readlink is already used in other
places of this file, so use it here as well.

Change-Id: I5acf8f5334a3e7c8de9cea1939d7e2b9af5f30ae
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/327844
Reviewed-by: Mike Frysinger <vapier@google.com>
Tested-by: Sebastian Wagner <sebix@sebix.at>
This commit is contained in:
Sebastian Wagner 2022-01-11 12:12:55 +01:00
parent 98bb76577d
commit a3ac816278

View File

@ -382,7 +382,7 @@ class MigrateWorkTreeTests(unittest.TestCase):
# Make sure the dir was transformed into a symlink. # Make sure the dir was transformed into a symlink.
self.assertTrue(dotgit.is_symlink()) self.assertTrue(dotgit.is_symlink())
self.assertEqual(str(dotgit.readlink()), '../../.repo/projects/src/test.git') self.assertEqual(os.readlink(dotgit), '../../.repo/projects/src/test.git')
# Make sure files were moved over. # Make sure files were moved over.
gitdir = tempdir / '.repo/projects/src/test.git' gitdir = tempdir / '.repo/projects/src/test.git'