[Python-checkins] python/dist/src/Lib/test test_shlex.py,1.2,1.3
niemeyer@users.sourceforge.net
niemeyer@users.sourceforge.net
Sat, 19 Apr 2003 18:57:05 -0700
Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1:/tmp/cvs-serv4707/Lib/test
Modified Files:
test_shlex.py
Log Message:
- Changed shlex.split() method to have more useful and
meaningful parameters.
Index: test_shlex.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_shlex.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** test_shlex.py 17 Apr 2003 23:04:22 -0000 1.2
--- test_shlex.py 20 Apr 2003 01:57:03 -0000 1.3
***************
*** 152,158 ****
item[0] = item[0].replace(r"\n", "\n")
! def splitTest(self, data, posix, spaces):
for i in range(len(data)):
! l = shlex.split(data[i][0], posix=posix, spaces=spaces)
self.assertEqual(l, data[i][1:],
"%s: %s != %s" %
--- 152,158 ----
item[0] = item[0].replace(r"\n", "\n")
! def splitTest(self, data, comments):
for i in range(len(data)):
! l = shlex.split(data[i][0], comments=comments)
self.assertEqual(l, data[i][1:],
"%s: %s != %s" %
***************
*** 168,178 ****
return ret
- def testSplit(self):
- """Test data splitting with non-posix parser"""
- self.splitTest(self.data, posix=0, spaces=0)
-
def testSplitPosix(self):
"""Test data splitting with posix parser"""
! self.splitTest(self.posix_data, posix=1, spaces=1)
def testCompat(self):
--- 168,174 ----
return ret
def testSplitPosix(self):
"""Test data splitting with posix parser"""
! self.splitTest(self.posix_data, comments=True)
def testCompat(self):