summaryrefslogtreecommitdiff
path: root/Lib
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2001-11-13 18:01:37 +0000
committerBarry Warsaw <barry@python.org>2001-11-13 18:01:37 +0000
commitf1dd4ca547a888f259dfd92bd20fd7754ff48a8d (patch)
tree03ea6f50a2ad228c9aa4ef72f49c05a6ab097d4d /Lib
parent064412137b7104b40d331535b32a1d4f8bc3bf38 (diff)
downloadcpython-f1dd4ca547a888f259dfd92bd20fd7754ff48a8d.tar.gz
Add tests for bug #478115, parsedate_tz() IndexError when a Date:
field exists with an empty value.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_email.py3
-rw-r--r--Lib/test/test_rfc822.py8
2 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_email.py b/Lib/test/test_email.py
index 6a6619988a..37ddc30a2f 100644
--- a/Lib/test/test_email.py
+++ b/Lib/test/test_email.py
@@ -937,6 +937,9 @@ class TestMiscellaneous(unittest.TestCase):
toff = time.timezone
self.assertEqual(offset, toff)
+ def test_parsedate(self):
+ self.assertEqual(Utils.parsedate(''), None)
+
# Test the iterator/generators
diff --git a/Lib/test/test_rfc822.py b/Lib/test/test_rfc822.py
index ab1746b126..cc6e27ba3c 100644
--- a/Lib/test/test_rfc822.py
+++ b/Lib/test/test_rfc822.py
@@ -118,6 +118,14 @@ class MessageTestCase(unittest.TestCase):
])
self.check(
+ 'To: Some One <someone@dom.ain>\n'
+ 'From: Anudder Persin <subuddy.else@dom.ain>\n'
+ 'Date:\n'
+ '\n'
+ 'test',
+ [('Some One', 'someone@dom.ain')])
+
+ self.check(
'To: person@dom.ain (User J. Person)\n\n',
[('User J. Person', 'person@dom.ain')])