[Python-checkins] r88241 - in python/branches/release31-maint: Lib/test/test_imaplib.py
alexander.belopolsky
python-checkins at python.org
Sat Jan 29 21:42:47 CET 2011
Author: alexander.belopolsky
Date: Sat Jan 29 21:42:46 2011
New Revision: 88241
Log:
Merged revisions 88239 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r88239 | alexander.belopolsky | 2011-01-29 14:49:40 -0500 (Sat, 29 Jan 2011) | 1 line
Issue #10939: Make Internaldate2tuple test more robust.
........
Modified:
python/branches/release31-maint/ (props changed)
python/branches/release31-maint/Lib/test/test_imaplib.py
Modified: python/branches/release31-maint/Lib/test/test_imaplib.py
==============================================================================
--- python/branches/release31-maint/Lib/test/test_imaplib.py (original)
+++ python/branches/release31-maint/Lib/test/test_imaplib.py Sat Jan 29 21:42:46 2011
@@ -12,6 +12,7 @@
import socketserver
import sys
import time
+import calendar
from test.support import reap_threads, verbose, transient_internet
import unittest
@@ -27,15 +28,16 @@
class TestImaplib(unittest.TestCase):
def test_Internaldate2tuple(self):
+ t0 = calendar.timegm((2000, 1, 1, 0, 0, 0, -1, -1, -1))
tt = imaplib.Internaldate2tuple(
- b'25 (INTERNALDATE "01-Jan-1970 00:00:00 +0000")')
- self.assertEqual(time.mktime(tt), 0)
+ b'25 (INTERNALDATE "01-Jan-2000 00:00:00 +0000")')
+ self.assertEqual(time.mktime(tt), t0)
tt = imaplib.Internaldate2tuple(
- b'25 (INTERNALDATE "01-Jan-1970 11:30:00 +1130")')
- self.assertEqual(time.mktime(tt), 0)
+ b'25 (INTERNALDATE "01-Jan-2000 11:30:00 +1130")')
+ self.assertEqual(time.mktime(tt), t0)
tt = imaplib.Internaldate2tuple(
- b'25 (INTERNALDATE "31-Dec-1969 12:30:00 -1130")')
- self.assertEqual(time.mktime(tt), 0)
+ b'25 (INTERNALDATE "31-Dec-1999 12:30:00 -1130")')
+ self.assertEqual(time.mktime(tt), t0)
def test_that_Time2Internaldate_returns_a_result(self):
# We can check only that it successfully produces a result,
More information about the Python-checkins
mailing list