mirror of
https://github.com/python/cpython.git
synced 2025-08-31 22:18:28 +00:00
Issue #10939: Fixed imaplib.Internaldate2tuple(). Thanks Joe Peterson
for the report and the patch. Reviewed by Georg Brandl.
This commit is contained in:
parent
ac039aee4d
commit
19e0a9e511
3 changed files with 15 additions and 3 deletions
|
@ -23,6 +23,17 @@ CERTFILE = None
|
|||
|
||||
class TestImaplib(unittest.TestCase):
|
||||
|
||||
def test_Internaldate2tuple(self):
|
||||
tt = imaplib.Internaldate2tuple(
|
||||
b'25 (INTERNALDATE "01-Jan-1970 00:00:00 +0000")')
|
||||
self.assertEqual(time.mktime(tt), 0)
|
||||
tt = imaplib.Internaldate2tuple(
|
||||
b'25 (INTERNALDATE "01-Jan-1970 11:30:00 +1130")')
|
||||
self.assertEqual(time.mktime(tt), 0)
|
||||
tt = imaplib.Internaldate2tuple(
|
||||
b'25 (INTERNALDATE "31-Dec-1969 12:30:00 -1130")')
|
||||
self.assertEqual(time.mktime(tt), 0)
|
||||
|
||||
def test_that_Time2Internaldate_returns_a_result(self):
|
||||
# We can check only that it successfully produces a result,
|
||||
# not the correctness of the result itself, since the result
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue