diff options
author | Walter Dörwald <walter@livinglogic.de> | 2003-06-19 10:21:14 (GMT) |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2003-06-19 10:21:14 (GMT) |
commit | a9da5ae07aa40d834b9bfb71de8af0f1b68f39ba (patch) | |
tree | 1b8b6a703d8923aaa38875ef5d57787c7c8c218a /Lib/test/test_posixpath.py | |
parent | 76ca1d428f96284ed58f4523b698ed95c6fdbdb2 (diff) | |
download | cpython-a9da5ae07aa40d834b9bfb71de8af0f1b68f39ba.zip cpython-a9da5ae07aa40d834b9bfb71de8af0f1b68f39ba.tar.gz cpython-a9da5ae07aa40d834b9bfb71de8af0f1b68f39ba.tar.bz2 |
Use find() instead of looping over the string in expanduser().
From SF patch #757058.
Diffstat (limited to 'Lib/test/test_posixpath.py')
-rw-r--r-- | Lib/test/test_posixpath.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_posixpath.py b/Lib/test/test_posixpath.py index 9ba7216..30551d8 100644 --- a/Lib/test/test_posixpath.py +++ b/Lib/test/test_posixpath.py @@ -332,12 +332,16 @@ class PosixPathTest(unittest.TestCase): def test_expanduser(self): self.assertEqual(posixpath.expanduser("foo"), "foo") - self.assert_(isinstance(posixpath.expanduser("~/"), basestring)) try: import pwd except ImportError: pass else: + self.assert_(isinstance(posixpath.expanduser("~/"), basestring)) + self.assertEqual( + posixpath.expanduser("~") + "/", + posixpath.expanduser("~/") + ) self.assert_(isinstance(posixpath.expanduser("~root/"), basestring)) self.assert_(isinstance(posixpath.expanduser("~foo/"), basestring)) |