diff options
author | Georg Brandl <georg@python.org> | 2009-04-05 14:48:49 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-04-05 14:48:49 (GMT) |
commit | 3f0ef20269aef0408a0a325bf5300a1ca676aa52 (patch) | |
tree | 203634c46d7f761c9aec9780b0a744775cc8047d /Lib/test/test_posixpath.py | |
parent | a7ec0726e2783c3ba886707df2a8ddd0e7e909db (diff) | |
download | cpython-3f0ef20269aef0408a0a325bf5300a1ca676aa52.zip cpython-3f0ef20269aef0408a0a325bf5300a1ca676aa52.tar.gz cpython-3f0ef20269aef0408a0a325bf5300a1ca676aa52.tar.bz2 |
#5471: fix expanduser() for $HOME set to "/".
Diffstat (limited to 'Lib/test/test_posixpath.py')
-rw-r--r-- | Lib/test/test_posixpath.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_posixpath.py b/Lib/test/test_posixpath.py index 46ac067..e6f750a 100644 --- a/Lib/test/test_posixpath.py +++ b/Lib/test/test_posixpath.py @@ -345,6 +345,11 @@ class PosixPathTest(unittest.TestCase): self.assert_(isinstance(posixpath.expanduser("~root/"), basestring)) self.assert_(isinstance(posixpath.expanduser("~foo/"), basestring)) + orig_home = os.environ['HOME'] + os.environ['HOME'] = '/' + self.assertEqual(posixpath.expanduser("~"), "/") + os.environ['HOME'] = orig_home + self.assertRaises(TypeError, posixpath.expanduser) def test_expandvars(self): |