[Python-checkins] python/dist/src/Lib/test test_strptime.py, 1.24, 1.25

bcannon at users.sourceforge.net bcannon at users.sourceforge.net
Mon Jul 12 21:34:06 CEST 2004


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28133/Lib/test

Modified Files:
	test_strptime.py 
Log Message:
Fix test case for when time.tzname[0] is either UTC or GMT.  Also have test
output more telling details when there is a failure.


Index: test_strptime.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_strptime.py,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** test_strptime.py	16 Nov 2003 16:17:48 -0000	1.24
--- test_strptime.py	12 Jul 2004 19:34:02 -0000	1.25
***************
*** 280,284 ****
          if sys.platform == "mac":
              return #MacOS9 has severely broken timezone support.
!         tz_name= time.tzname[0]
          try:
              original_tzname = time.tzname
--- 280,286 ----
          if sys.platform == "mac":
              return #MacOS9 has severely broken timezone support.
!         tz_name = time.tzname[0]
!         if tz_name.lower() in ("UTC", "GMT"):
!             return
          try:
              original_tzname = time.tzname
***************
*** 287,291 ****
              time.daylight = 1
              tz_value = _strptime.strptime(tz_name, "%Z")[8]
!             self.failUnlessEqual(tz_value, -1)
          finally:
              time.tzname = original_tzname
--- 289,296 ----
              time.daylight = 1
              tz_value = _strptime.strptime(tz_name, "%Z")[8]
!             self.failUnlessEqual(tz_value, -1,
!                     "%s lead to a timezone value of %s instead of -1 when "
!                     "time.daylight set to %s and passing in %s" %
!                     (time.tzname, tz_value, time.daylight, tz_name))
          finally:
              time.tzname = original_tzname



More information about the Python-checkins mailing list