summaryrefslogtreecommitdiffstats
path: root/Lib/email/test
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2002-12-30 17:20:53 (GMT)
committerBarry Warsaw <barry@python.org>2002-12-30 17:20:53 (GMT)
commit795833fbc6568a1aa45e912093a1a8788b107dc1 (patch)
tree60ba45b610ed9b2612d4c97050b8d697896745d2 /Lib/email/test
parent1024bf836412fbdec9bb27145b38ce2cfd33d9ec (diff)
downloadcpython-795833fbc6568a1aa45e912093a1a8788b107dc1.zip
cpython-795833fbc6568a1aa45e912093a1a8788b107dc1.tar.gz
cpython-795833fbc6568a1aa45e912093a1a8788b107dc1.tar.bz2
test_parsedate_compact(): A test for optional FWS between the comma
and the day number in an RFC 2822 date specification. See bug #552345.
Diffstat (limited to 'Lib/email/test')
-rw-r--r--Lib/email/test/test_email.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/email/test/test_email.py b/Lib/email/test/test_email.py
index cbcc0df..df6c350 100644
--- a/Lib/email/test/test_email.py
+++ b/Lib/email/test/test_email.py
@@ -1670,6 +1670,11 @@ class TestMiscellaneous(unittest.TestCase):
def test_parsedate_none(self):
self.assertEqual(Utils.parsedate(''), None)
+ def test_parsedate_compact(self):
+ # The FWS after the comma is optional
+ self.assertEqual(Utils.parsedate('Wed,3 Apr 2002 14:58:26 +0800'),
+ Utils.parsedate('Wed, 3 Apr 2002 14:58:26 +0800'))
+
def test_parseaddr_empty(self):
self.assertEqual(Utils.parseaddr('<>'), ('', ''))
self.assertEqual(Utils.formataddr(Utils.parseaddr('<>')), '')