[Checkins] SVN: DateTime/branches/2.12/src/DateTime/tests/testDateTime.py backport improvement to test time
Hano Schlichting
cvs-admin at zope.org
Fri Aug 10 20:54:49 UTC 2012
Log message for revision 127466:
backport improvement to test time
Changed:
U DateTime/branches/2.12/src/DateTime/tests/testDateTime.py
-=-
Modified: DateTime/branches/2.12/src/DateTime/tests/testDateTime.py
===================================================================
--- DateTime/branches/2.12/src/DateTime/tests/testDateTime.py 2012-08-10 20:53:39 UTC (rev 127465)
+++ DateTime/branches/2.12/src/DateTime/tests/testDateTime.py 2012-08-10 20:54:45 UTC (rev 127466)
@@ -501,22 +501,22 @@
self.assertEqual(int(times[0]), dt.h_24())
self.assertEqual(int(times[1]), dt.minute())
self.assertEqual(int(times[2]), int(dt.second()))
- self.assertEqual(dts[5], "%+03d%02d" % divmod( (-offset/60), 60) )
+ self.assertEqual(dts[5], "%+03d%02d" % divmod((-offset / 60), 60))
def testInternationalDateformat(self):
- for year in range(1990, 2020):
- for month in range (1, 13):
- for day in range(1, 32):
+ for year in (1990, 2001, 2020):
+ for month in (1, 12):
+ for day in (1, 12, 28, 31):
try:
- d_us = DateTime("%d/%d/%d" % (year,month,day))
- except:
+ d_us = DateTime("%d/%d/%d" % (year, month, day))
+ except Exception:
continue
- d_int = DateTime("%d.%d.%d" % (day,month,year),
+ d_int = DateTime("%d.%d.%d" % (day, month, year),
datefmt="international")
self.assertEqual(d_us, d_int)
- d_int = DateTime("%d/%d/%d" % (day,month,year),
+ d_int = DateTime("%d/%d/%d" % (day, month, year),
datefmt="international")
self.assertEqual(d_us, d_int)
More information about the checkins
mailing list