From: Barry Warsaw Date: Mon, 30 Dec 2002 16:19:52 +0000 (+0000) Subject: test_name_with_dots(): A new test to ensure that we're implementing X-Git-Tag: v2.3c1~2828 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=edb59c1ee8872d4a9f5e57b39874ca1d115f2fd4;p=thirdparty%2FPython%2Fcpython.git test_name_with_dots(): A new test to ensure that we're implementing RFC 2822's rules w.r.t. dots in the realname part of address fields. --- diff --git a/Lib/email/test/test_email.py b/Lib/email/test/test_email.py index 61b412a9afe0..cbcc0df1b11a 100644 --- a/Lib/email/test/test_email.py +++ b/Lib/email/test/test_email.py @@ -1687,6 +1687,15 @@ class TestMiscellaneous(unittest.TestCase): b = 'person@dom.ain' self.assertEqual(Utils.parseaddr(Utils.formataddr((a, b))), (a, b)) + def test_name_with_dot(self): + x = 'John X. Doe ' + y = '"John X. Doe" ' + a, b = ('John X. Doe', 'jxd@example.com') + self.assertEqual(Utils.parseaddr(x), (a, b)) + self.assertEqual(Utils.parseaddr(y), (a, b)) + # formataddr() quotes the name if there's a dot in it + self.assertEqual(Utils.formataddr((a, b)), y) + def test_quote_dump(self): self.assertEqual( Utils.formataddr(('A Silly; Person', 'person@dom.ain')),