[Python-checkins] python/dist/src/Lib/test test_imaplib.py,1.2,1.3

pierslauder@users.sourceforge.net pierslauder@users.sourceforge.net
Mon, 17 Jun 2002 00:06:27 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv13277/dist/src/Lib/test

Modified Files:
	test_imaplib.py 
Log Message:
Alter text test arg to obey new rule, also include inverse test to make time-zone independant

Index: test_imaplib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_imaplib.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** test_imaplib.py	5 Jan 2002 17:12:57 -0000	1.2
--- test_imaplib.py	17 Jun 2002 07:06:24 -0000	1.3
***************
*** 2,12 ****
  import time
  
- # We can check only that it successfully produces a result,
- # not the correctness of the result itself, since the result
- # depends on the timezone the machine is in.
- 
  timevalues = [2000000000, 2000000000.0, time.localtime(2000000000),
!               "18-May-2033 05:33:20 +0200"]
  
  for t in timevalues:
!     imaplib.Time2Internaldate(t)
--- 2,11 ----
  import time
  
  timevalues = [2000000000, 2000000000.0, time.localtime(2000000000),
!               '"18-May-2033 05:33:20 +0200"', '"18-May-2033 13:33:20 +1000"']
! 
! check = timevalues[2]
  
  for t in timevalues:
!     if check <> imaplib.Internaldate2tuple('INTERNALDATE ' + imaplib.Time2Internaldate(t)):
!         print 'incorrect result when converting', `t`