Kaydet (Commit) b86a2e80 authored tarafından Jack Jansen's avatar Jack Jansen

Use os.path.realpath() in stead of abspath(), so the tests don't fail if

we have a symlink somewhere in the TESTFN path.
üst 30a634e0
...@@ -21,11 +21,11 @@ class TestMacfs(unittest.TestCase): ...@@ -21,11 +21,11 @@ class TestMacfs(unittest.TestCase):
def test_fsspec(self): def test_fsspec(self):
fss = macfs.FSSpec(test_support.TESTFN) fss = macfs.FSSpec(test_support.TESTFN)
self.assertEqual(os.path.abspath(test_support.TESTFN), fss.as_pathname()) self.assertEqual(os.path.realpath(test_support.TESTFN), fss.as_pathname())
def test_fsref(self): def test_fsref(self):
fsr = macfs.FSRef(test_support.TESTFN) fsr = macfs.FSRef(test_support.TESTFN)
self.assertEqual(os.path.abspath(test_support.TESTFN), fsr.as_pathname()) self.assertEqual(os.path.realpath(test_support.TESTFN), fsr.as_pathname())
def test_coercion(self): def test_coercion(self):
fss = macfs.FSSpec(test_support.TESTFN) fss = macfs.FSSpec(test_support.TESTFN)
......
...@@ -68,7 +68,7 @@ class TestMacostools(unittest.TestCase): ...@@ -68,7 +68,7 @@ class TestMacostools(unittest.TestCase):
pass pass
macostools.mkalias(test_support.TESTFN, TESTFN2) macostools.mkalias(test_support.TESTFN, TESTFN2)
fss, _, _ = macfs.ResolveAliasFile(TESTFN2) fss, _, _ = macfs.ResolveAliasFile(TESTFN2)
self.assertEqual(fss.as_pathname(), os.path.abspath(test_support.TESTFN)) self.assertEqual(fss.as_pathname(), os.path.realpath(test_support.TESTFN))
def test_mkalias_relative(self): def test_mkalias_relative(self):
try: try:
...@@ -77,7 +77,7 @@ class TestMacostools(unittest.TestCase): ...@@ -77,7 +77,7 @@ class TestMacostools(unittest.TestCase):
pass pass
macostools.mkalias(test_support.TESTFN, TESTFN2, sys.prefix) macostools.mkalias(test_support.TESTFN, TESTFN2, sys.prefix)
fss, _, _ = macfs.ResolveAliasFile(TESTFN2) fss, _, _ = macfs.ResolveAliasFile(TESTFN2)
self.assertEqual(fss.as_pathname(), os.path.abspath(test_support.TESTFN)) self.assertEqual(fss.as_pathname(), os.path.realpath(test_support.TESTFN))
def test_main(): def test_main():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment