Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f0a70f6

Browse files
author
Piers Lauder
committed
Alter text test arg to obey new rule, also include inverse test to make time-zone independant
1 parent 0e3a577 commit f0a70f6

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

Lib/test/test_imaplib.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import imaplib
22
import time
33

4-
# We can check only that it successfully produces a result,
5-
# not the correctness of the result itself, since the result
6-
# depends on the timezone the machine is in.
7-
84
timevalues = [2000000000, 2000000000.0, time.localtime(2000000000),
9-
"18-May-2033 05:33:20 +0200"]
5+
'"18-May-2033 05:33:20 +0200"', '"18-May-2033 13:33:20 +1000"']
6+
7+
check = timevalues[2]
108

119
for t in timevalues:
12-
imaplib.Time2Internaldate(t)
10+
if check <> imaplib.Internaldate2tuple('INTERNALDATE ' + imaplib.Time2Internaldate(t)):
11+
print 'incorrect result when converting', `t`

0 commit comments

Comments
 (0)