Update of /cvsroot/pywin32/pywin32/win32/test
In directory sc8-pr-cvs1:/tmp/cvs-serv6950/win32/test
Modified Files:
test_pywintypes.py
Log Message:
Add a test that would crash PyTime.Format()
Index: test_pywintypes.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/test/test_pywintypes.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** test_pywintypes.py 18 Oct 2003 23:34:07 -0000 1.1
--- test_pywintypes.py 22 Jan 2004 04:39:48 -0000 1.2
***************
*** 11,14 ****
--- 11,25 ----
self.assertEquals(pytime_current.Format(format_string), time.strftime(format_string, struct_current))
+ def testPyTimePrint(self):
+ # This used to crash with an invalid, or too early time.
+ # We don't really want to check that it does cause a ValueError
+ # (as hopefully this wont be true forever). So either working, or
+ # ValueError is OK.
+ t = pywintypes.Time(-2)
+ try:
+ t.Format()
+ except ValueError:
+ return
+
if __name__ == '__main__':
unittest.main()
|