summaryrefslogtreecommitdiff
path: root/Lib/test/test_posixpath.py
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2003-07-01 03:33:31 +0000
committerNeal Norwitz <nnorwitz@gmail.com>2003-07-01 03:33:31 +0000
commitac97906462d7811e7920a53893bcbe8869738464 (patch)
treeccc2009de6952dd88fa53dd23e70861c6348c06a /Lib/test/test_posixpath.py
parent1e6882da6928032647c5ebeb2886c5986a2750ee (diff)
downloadcpython-ac97906462d7811e7920a53893bcbe8869738464.tar.gz
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/test/test_posixpath.py')
-rw-r--r--Lib/test/test_posixpath.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/test/test_posixpath.py b/Lib/test/test_posixpath.py
index 37e96286d8..fcf2ef56c6 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))