diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2003-07-01 03:33:31 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2003-07-01 03:33:31 (GMT) |
commit | 168e73d25e965888aa307fd74de597a35b660e1b (patch) | |
tree | 50f0cc25516826b0e58c980a3de57d97b6b3ed84 /Lib | |
parent | 0ccda1ee1096799a30a6480feab0f6032f707c01 (diff) | |
download | cpython-168e73d25e965888aa307fd74de597a35b660e1b.zip cpython-168e73d25e965888aa307fd74de597a35b660e1b.tar.gz cpython-168e73d25e965888aa307fd74de597a35b660e1b.tar.bz2 |
Fix SF #763362, test_posixpath failed
Don't check expanduser('~') if the home directory == the root directory
(ie, we are running as root).
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_posixpath.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/test/test_posixpath.py b/Lib/test/test_posixpath.py index 37e9628..fcf2ef5 100644 --- a/Lib/test/test_posixpath.py +++ b/Lib/test/test_posixpath.py @@ -338,10 +338,12 @@ class PosixPathTest(unittest.TestCase): pass else: self.assert_(isinstance(posixpath.expanduser("~/"), basestring)) - self.assertEqual( - posixpath.expanduser("~") + "/", - posixpath.expanduser("~/") - ) + # if home directory == root directory, this test makes no sense + if posixpath.expanduser("~") != '/': + self.assertEqual( + posixpath.expanduser("~") + "/", + posixpath.expanduser("~/") + ) self.assert_(isinstance(posixpath.expanduser("~root/"), basestring)) self.assert_(isinstance(posixpath.expanduser("~foo/"), basestring)) |