From edf66107588ec36888b83bff09586d673308a581 Mon Sep 17 00:00:00 2001 From: "Michael W. Hudson" Date: Mon, 23 Sep 2002 13:32:53 +0000 Subject: [PATCH] backport bwarsaw's checkin of revision 1.17 of test_rfc822.py parseaddr(): Fixed in the same way that Message.getaddrlist() was fixed (re: SF bug #555035). Include a unittest. --- Lib/test/test_rfc822.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Lib/test/test_rfc822.py b/Lib/test/test_rfc822.py index 259c058de2d6..470b92878fe1 100644 --- a/Lib/test/test_rfc822.py +++ b/Lib/test/test_rfc822.py @@ -194,6 +194,15 @@ class MessageTestCase(unittest.TestCase): ## self.assertEqual(len(lst), OBSCENELY_LONG_HEADER_MULTIPLIER) + def test_parseaddr(self): + eq = self.assertEqual + eq(rfc822.parseaddr('<>'), ('', '')) + eq(rfc822.parseaddr('aperson@dom.ain'), ('', 'aperson@dom.ain')) + eq(rfc822.parseaddr('bperson@dom.ain (Bea A. Person)'), + ('Bea A. Person', 'bperson@dom.ain')) + eq(rfc822.parseaddr('Cynthia Person '), + ('Cynthia Person', 'cperson@dom.ain')) + def test_main(): test_support.run_unittest(MessageTestCase) -- 2.47.3