[Python-checkins] CVS: python/dist/src/Lib/test test_email.py,1.21,1.22
Barry Warsaw
bwarsaw@users.sourceforge.net
Mon, 26 Nov 2001 23:12:37 -0800
Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv5345
Modified Files:
test_email.py
Log Message:
test_formatdate(): Integrating Jack's 22b2 branch fix for Mac epoch:
More changes to the formatdate epoch test: the Mac epoch is in
localtime, so east of GMT it falls in 1903:-( Changed the test to
obtain the epoch in both local time and GMT, and do the right
thing in the comparisons. As a sanity measure also check that
day/month is Jan 1.
Index: test_email.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_email.py,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** test_email.py 2001/11/19 18:38:42 1.21
--- test_email.py 2001/11/27 07:12:35 1.22
***************
*** 922,931 ****
def test_formatdate(self):
now = 1005327232.109884
! epoch = time.gmtime(0)[0]
# When does the epoch start?
! if epoch == 1970:
# traditional Unix epoch
matchdate = 'Fri, 09 Nov 2001 17:33:52 -0000'
! elif epoch == 1904:
# Mac epoch
matchdate = 'Sat, 09 Nov 1935 16:33:52 -0000'
--- 922,932 ----
def test_formatdate(self):
now = 1005327232.109884
! gm_epoch = time.gmtime(0)[0:3]
! loc_epoch = time.localtime(0)[0:3]
# When does the epoch start?
! if gm_epoch == (1970, 1, 1):
# traditional Unix epoch
matchdate = 'Fri, 09 Nov 2001 17:33:52 -0000'
! elif loc_epoch == (1904, 1, 1):
# Mac epoch
matchdate = 'Sat, 09 Nov 1935 16:33:52 -0000'