mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
remove o/s dependancy from test
This commit is contained in:
parent
35b37a5c11
commit
385a77acad
2 changed files with 37 additions and 11 deletions
|
@ -1,11 +1,12 @@
|
|||
import imaplib
|
||||
import time
|
||||
|
||||
timevalues = [2000000000, 2000000000.0, time.localtime(2000000000),
|
||||
'"18-May-2033 05:33:20 +0200"', '"18-May-2033 13:33:20 +1000"']
|
||||
# Can't use time.time() values, as they are O/S specific
|
||||
|
||||
check = timevalues[2]
|
||||
timevalues = [(2033, 5, 18, 3, 33, 20, 2, 138, 0), '"18-May-2033 13:33:20 +1000"']
|
||||
|
||||
for t in timevalues:
|
||||
if check <> imaplib.Internaldate2tuple('INTERNALDATE ' + imaplib.Time2Internaldate(t)):
|
||||
t1 = imaplib.Time2Internaldate(t)
|
||||
t2 = imaplib.Time2Internaldate(imaplib.Internaldate2tuple('INTERNALDATE ' + imaplib.Time2Internaldate(t)))
|
||||
if t1 <> t2:
|
||||
print 'incorrect result when converting', `t`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue