[Python-checkins] python/dist/src/Lib/test test_posixpath.py,1.6,1.7
doerwalter@users.sourceforge.net
doerwalter@users.sourceforge.net
Thu, 19 Jun 2003 03:21:16 -0700
Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1:/tmp/cvs-serv14238/Lib/test
Modified Files:
test_posixpath.py
Log Message:
Use find() instead of looping over the string in expanduser().
>From SF patch #757058.
Index: test_posixpath.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_posixpath.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** test_posixpath.py 16 Jun 2003 21:54:50 -0000 1.6
--- test_posixpath.py 19 Jun 2003 10:21:14 -0000 1.7
***************
*** 333,337 ****
def test_expanduser(self):
self.assertEqual(posixpath.expanduser("foo"), "foo")
- self.assert_(isinstance(posixpath.expanduser("~/"), basestring))
try:
import pwd
--- 333,336 ----
***************
*** 339,342 ****
--- 338,346 ----
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))