mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
Fix SF #763362, test_posixpath failed
Don't check expanduser('~') if the home directory == the root directory (ie, we are running as root).
This commit is contained in:
parent
0ccda1ee10
commit
168e73d25e
1 changed files with 6 additions and 4 deletions
|
@ -338,10 +338,12 @@ class PosixPathTest(unittest.TestCase):
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
self.assert_(isinstance(posixpath.expanduser("~/"), basestring))
|
self.assert_(isinstance(posixpath.expanduser("~/"), basestring))
|
||||||
self.assertEqual(
|
# if home directory == root directory, this test makes no sense
|
||||||
posixpath.expanduser("~") + "/",
|
if posixpath.expanduser("~") != '/':
|
||||||
posixpath.expanduser("~/")
|
self.assertEqual(
|
||||||
)
|
posixpath.expanduser("~") + "/",
|
||||||
|
posixpath.expanduser("~/")
|
||||||
|
)
|
||||||
self.assert_(isinstance(posixpath.expanduser("~root/"), basestring))
|
self.assert_(isinstance(posixpath.expanduser("~root/"), basestring))
|
||||||
self.assert_(isinstance(posixpath.expanduser("~foo/"), basestring))
|
self.assert_(isinstance(posixpath.expanduser("~foo/"), basestring))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue