diff options
author | Barry Warsaw <barry@python.org> | 2001-11-27 07:12:35 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2001-11-27 07:12:35 (GMT) |
commit | e274864004995f7b8b80abe1cea61b5ec8111ad7 (patch) | |
tree | 22dc5f4dec1723cb8233b07dd6792942072e1cc2 /Lib/test/test_email.py | |
parent | beafc795df914df127a3c5c7dcbb98435ebc8ff2 (diff) | |
download | cpython-e274864004995f7b8b80abe1cea61b5ec8111ad7.zip cpython-e274864004995f7b8b80abe1cea61b5ec8111ad7.tar.gz cpython-e274864004995f7b8b80abe1cea61b5ec8111ad7.tar.bz2 |
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.
Diffstat (limited to 'Lib/test/test_email.py')
-rw-r--r-- | Lib/test/test_email.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_email.py b/Lib/test/test_email.py index 7fbae5e..2e7cc00 100644 --- a/Lib/test/test_email.py +++ b/Lib/test/test_email.py @@ -921,12 +921,13 @@ class TestMiscellaneous(unittest.TestCase): def test_formatdate(self): now = 1005327232.109884 - epoch = time.gmtime(0)[0] + gm_epoch = time.gmtime(0)[0:3] + loc_epoch = time.localtime(0)[0:3] # When does the epoch start? - if epoch == 1970: + if gm_epoch == (1970, 1, 1): # traditional Unix epoch matchdate = 'Fri, 09 Nov 2001 17:33:52 -0000' - elif epoch == 1904: + elif loc_epoch == (1904, 1, 1): # Mac epoch matchdate = 'Sat, 09 Nov 1935 16:33:52 -0000' else: |