From: Barry Warsaw Date: Tue, 13 Nov 2001 18:01:37 +0000 (+0000) Subject: Add tests for bug #478115, parsedate_tz() IndexError when a Date: X-Git-Tag: v2.2.1c1~782 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=19c10caaa41be087d0bed42a3654eaf8541164f9;p=python Add tests for bug #478115, parsedate_tz() IndexError when a Date: field exists with an empty value. --- 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 @@ -117,6 +117,14 @@ class MessageTestCase(unittest.TestCase): ('', 'goit@lip.com'), ]) + self.check( + 'To: Some One \n' + 'From: Anudder Persin \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')])