summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAlexander Belopolsky <alexander.belopolsky@gmail.com>2011-01-29 20:42:46 (GMT)
committerAlexander Belopolsky <alexander.belopolsky@gmail.com>2011-01-29 20:42:46 (GMT)
commit74d31a00d0bef8abea1fb8176771f9dd17dbcd83 (patch)
tree6c173a08e234272051b125801258877a17f9cc6a /Lib
parent26d55edc2f7e70cca6886ecadebf7e5f11950b83 (diff)
downloadcpython-74d31a00d0bef8abea1fb8176771f9dd17dbcd83.zip
cpython-74d31a00d0bef8abea1fb8176771f9dd17dbcd83.tar.gz
cpython-74d31a00d0bef8abea1fb8176771f9dd17dbcd83.tar.bz2
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. ........
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_imaplib.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/Lib/test/test_imaplib.py b/Lib/test/test_imaplib.py
index 39984c5..6116c8b 100644
--- a/Lib/test/test_imaplib.py
+++ b/Lib/test/test_imaplib.py
@@ -12,6 +12,7 @@ import socket
import socketserver
import sys
import time
+import calendar
from test.support import reap_threads, verbose, transient_internet
import unittest
@@ -27,15 +28,16 @@ CERTFILE = None
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,