[Python-checkins] python/dist/src/Lib/test test_strptime.py,1.11,1.12
bcannon@users.sourceforge.net
bcannon@users.sourceforge.net
Mon, 28 Apr 2003 14:30:17 -0700
Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1:/tmp/cvs-serv22886/Lib/test
Modified Files:
test_strptime.py
Log Message:
Raise a ValueError when there is data that was not covered in the format string. Done to match behavior of pre-existing C-based strptime implementations.
Index: test_strptime.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_strptime.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** test_strptime.py 19 Apr 2003 04:00:56 -0000 1.11
--- test_strptime.py 28 Apr 2003 21:30:13 -0000 1.12
***************
*** 228,231 ****
--- 228,235 ----
format="%A")
+ def test_unconverteddata(self):
+ # Check ValueError is raised when there is unconverted data
+ self.assertRaises(ValueError, _strptime.strptime, "10 12", "%m")
+
def helper(self, directive, position):
"""Helper fxn in testing."""