]> granicus.if.org Git - python/commitdiff
test_getaddresses_nasty(): A test for mimelib SF bug # 697641.
authorBarry Warsaw <barry@python.org>
Mon, 17 Mar 2003 18:36:37 +0000 (18:36 +0000)
committerBarry Warsaw <barry@python.org>
Mon, 17 Mar 2003 18:36:37 +0000 (18:36 +0000)
Lib/email/test/test_email.py

index 4bc111a215cb73043d720d2f7dc160d01bc1c968..8950e0d17a7106f002b26af3a2c40f8eb32158ef 100644 (file)
@@ -1926,6 +1926,16 @@ class TestMiscellaneous(unittest.TestCase):
            [('Al Person', 'aperson@dom.ain'),
             ('Bud Person', 'bperson@dom.ain')])
 
+    def test_getaddresses_nasty(self):
+        eq = self.assertEqual
+        eq(Utils.getaddresses(['foo: ;']), [('', '')])
+        eq(Utils.getaddresses(
+           ['[]*-- =~$']),
+           [('', ''), ('', ''), ('', '*--')])
+        eq(Utils.getaddresses(
+           ['foo: ;', '"Jason R. Mastaler" <jason@dom.ain>']),
+           [('', ''), ('Jason R. Mastaler', 'jason@dom.ain')])
+
     def test_utils_quote_unquote(self):
         eq = self.assertEqual
         msg = Message()