Commit ac979064 authored by Neal Norwitz's avatar Neal Norwitz

Fix SF #763362, test_posixpath failed

Don't check expanduser('~') if the home directory == the root directory
(ie, we are running as root).
parent 1e6882da
...@@ -338,6 +338,8 @@ class PosixPathTest(unittest.TestCase): ...@@ -338,6 +338,8 @@ class PosixPathTest(unittest.TestCase):
pass pass
else: else:
self.assert_(isinstance(posixpath.expanduser("~/"), basestring)) self.assert_(isinstance(posixpath.expanduser("~/"), basestring))
# if home directory == root directory, this test makes no sense
if posixpath.expanduser("~") != '/':
self.assertEqual( self.assertEqual(
posixpath.expanduser("~") + "/", posixpath.expanduser("~") + "/",
posixpath.expanduser("~/") posixpath.expanduser("~/")
......
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