diff options
author | Barry Warsaw <barry@python.org> | 2006-02-03 04:44:52 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2006-02-03 04:44:52 (GMT) |
commit | 602426e3cf4a65fe37fbe17a3e3a106d0a998811 (patch) | |
tree | e823b43b604a4bd370826c094e277722aee7f132 /Lib/email/test | |
parent | 5a49fae1ab02f94fe0753a0f8da1bafa39a33f3c (diff) | |
download | cpython-602426e3cf4a65fe37fbe17a3e3a106d0a998811.zip cpython-602426e3cf4a65fe37fbe17a3e3a106d0a998811.tar.gz cpython-602426e3cf4a65fe37fbe17a3e3a106d0a998811.tar.bz2 |
parsedate_tz(): Minor cleanup.
Port from Python 2.3/email 2.5: Add a test for the tm_yday field is 1 in the
return of parsedate().
Diffstat (limited to 'Lib/email/test')
-rw-r--r-- | Lib/email/test/test_email.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/email/test/test_email.py b/Lib/email/test/test_email.py index c22603d..a68ceba 100644 --- a/Lib/email/test/test_email.py +++ b/Lib/email/test/test_email.py @@ -2104,6 +2104,15 @@ class TestMiscellaneous(TestEmailBase): eq(Utils.parsedate_tz('5 Feb 2003 13:47:26 -0800'), (2003, 2, 5, 13, 47, 26, 0, 1, 0, -28800)) + def test_parsedate_acceptable_to_time_functions(self): + eq = self.assertEqual + timetup = Utils.parsedate('5 Feb 2003 13:47:26 -0800') + eq(int(time.mktime(timetup)), 1044470846) + eq(int(time.strftime('%Y', timetup)), 2003) + timetup = Utils.parsedate_tz('5 Feb 2003 13:47:26 -0800') + eq(int(time.mktime(timetup[:9])), 1044470846) + eq(int(time.strftime('%Y', timetup[:9])), 2003) + def test_parseaddr_empty(self): self.assertEqual(Utils.parseaddr('<>'), ('', '')) self.assertEqual(Utils.formataddr(Utils.parseaddr('<>')), '') |