]> granicus.if.org Git - python/commitdiff
Add tests for bug #478115, parsedate_tz() IndexError when a Date:
authorBarry Warsaw <barry@python.org>
Tue, 13 Nov 2001 18:01:37 +0000 (18:01 +0000)
committerBarry Warsaw <barry@python.org>
Tue, 13 Nov 2001 18:01:37 +0000 (18:01 +0000)
field exists with an empty value.

Lib/test/test_email.py
Lib/test/test_rfc822.py

index 6a6619988a628e365196cd25f18f878e9d812f36..37ddc30a2f95f05db538dce4dc1238b99c7883c0 100644 (file)
@@ -937,6 +937,9 @@ class TestMiscellaneous(unittest.TestCase):
                 toff = time.timezone
             self.assertEqual(offset, toff)
 
+    def test_parsedate(self):
+        self.assertEqual(Utils.parsedate(''), None)
+
 
 \f
 # Test the iterator/generators
index ab1746b126e7d6cb8c23bbab5c91adbb437e91fa..cc6e27ba3cbea175058ee16fc2030bd142db3e01 100644 (file)
@@ -117,6 +117,14 @@ class MessageTestCase(unittest.TestCase):
              ('', 'goit@lip.com'),
              ])
 
+        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')])