[Zope-Checkins] CVS: Zope/lib/python/DateTime/tests - testDateTime.py:1.21.12.3

Yvo Schubbe schubbe at web.de
Thu Jan 1 13:02:03 EST 2004


Update of /cvs-repository/Zope/lib/python/DateTime/tests
In directory cvs.zope.org:/tmp/cvs-serv13410/lib/python/DateTime/tests

Modified Files:
      Tag: Zope-2_7-branch
	testDateTime.py 
Log Message:
- fixed _calcTimezoneName (Collector #484)
- fixed safegmtime to catch ValueError instead of IOError (Python 2.3)
- synced safelocaltime with safegmtime
- some whitspace cleanup


=== Zope/lib/python/DateTime/tests/testDateTime.py 1.21.12.2 => 1.21.12.3 ===
--- Zope/lib/python/DateTime/tests/testDateTime.py:1.21.12.2	Thu Nov 20 12:12:19 2003
+++ Zope/lib/python/DateTime/tests/testDateTime.py	Thu Jan  1 13:01:57 2004
@@ -232,11 +232,11 @@
         # A negative numerical timezone
         dt = DateTime('Tue, 24 Jul 2001 09:41:03 -0400')
         self.assertEqual(dt.tzoffset(), -14400)
-        
+
         # A positive numerical timzone
         dt = DateTime('Tue, 6 Dec 1966 01:41:03 +0200')
         self.assertEqual(dt.tzoffset(), 7200)
-        
+
         # A negative numerical timezone with minutes.
         dt = DateTime('Tue, 24 Jul 2001 09:41:03 -0637')
         self.assertEqual(dt.tzoffset(), -23820)
@@ -244,7 +244,6 @@
         # A positive numerical timezone with minutes.
         dt = DateTime('Tue, 24 Jul 2001 09:41:03 +0425')
         self.assertEqual(dt.tzoffset(), 15900)
-        
 
     def testISO8601(self):
         ''' iso 8601 dates '''
@@ -327,6 +326,14 @@
 
                     d_int = DateTime("%d/%d/%d" % (day,month,year), datefmt="international")
                     self.assertEqual(d_us, d_int)
+
+    def test_calcTimezoneName(self):
+        timezone_dependent_epoch = 2177452800L
+        try:
+            DateTime()._calcTimezoneName(timezone_dependent_epoch, 0)
+        except DateTime.TimeError:
+            self.fail('Zope Collector issue #484 (negative time bug): '
+                      'TimeError raised')
 
 
 def test_suite():




More information about the Zope-Checkins mailing list