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

Jim Fulton jim@zope.com
Mon, 14 Jan 2002 15:46:10 -0500


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

Modified Files:
	testDateTime.py 
Log Message:
The DateTime module was changed to no longer import the string module,
but one of the uses of string.atoi wasn't fixed.  There also wasn't a
test for this. :(

Fixed bug in handling numneric time-zone offsets. We need to subtract,
rather than add the offset, since the offset is the offset of the
local time from UT, not the other way around.


=== Zope/lib/python/DateTime/tests/testDateTime.py 1.6 => 1.7 ===
         assert ddays == 3000000L, ddays
 
+    def test_tzoffset(self):
+        '''Test time-zone given as an offset
+        '''
+        from time import gmtime
+
+        dt = DateTime('Tue, 24 Jul 2001 09:41:03 -0400')
+        self.assertEqual(gmtime(dt.timeTime())[:6],
+                         (2001,7,24,13,41,3))
 
     def testISO8601(self):
         ''' iso 8601 dates '''