[Python-checkins] CVS: python/dist/src/Lib/test test_email.py,1.15,1.16

Barry Warsaw bwarsaw@users.sourceforge.net
2001年11月09日 11:31:00 -0800


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv18732
Modified Files:
	test_email.py 
Log Message:
test_formatdate(): Don't do the localtime test if we don't have
strptime() -- I'm too lazy to code it otherwise.
Index: test_email.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_email.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** test_email.py	2001年11月09日 17:46:17	1.15
--- test_email.py	2001年11月09日 19:30:58	1.16
***************
*** 925,938 ****
 ldate = Utils.formatdate(now, localtime=1)
 self.assertEqual(gdate, 'Fri, 09 Nov 2001 17:33:52 -0000')
! # It's a little tougher to test for localtime, but we'll try
! gtime = time.strptime(gdate.split()[4], '%H:%M:%S')
! ltime = time.strptime(ldate.split()[4], '%H:%M:%S')
! zone = ldate.split()[5]
! offset = int(zone[:3]) * -3600 + int(zone[-2:])
! if time.daylight and time.localtime(now)[-1]:
! toff = time.altzone
! else:
! toff = time.timezone
! self.assertEqual(offset, toff)
 
 
--- 925,940 ----
 ldate = Utils.formatdate(now, localtime=1)
 self.assertEqual(gdate, 'Fri, 09 Nov 2001 17:33:52 -0000')
! # It's a little tougher to test for localtime, but we'll try. Skip if
! # we don't have strptime().
! if hasattr(time, 'striptime'):
! gtime = time.strptime(gdate.split()[4], '%H:%M:%S')
! ltime = time.strptime(ldate.split()[4], '%H:%M:%S')
! zone = ldate.split()[5]
! offset = int(zone[:3]) * -3600 + int(zone[-2:])
! if time.daylight and time.localtime(now)[-1]:
! toff = time.altzone
! else:
! toff = time.timezone
! self.assertEqual(offset, toff)
 
 

AltStyle によって変換されたページ (->オリジナル) /