From a2e64702ca3e5d04c1b65c11bb9fdda32720809a Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Mon, 10 Mar 2003 19:18:34 +0000 Subject: test_escape_backslashes(): A test for SF bug #663369 by Matthew Woodcraft. --- Lib/email/test/test_email.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Lib/email/test/test_email.py b/Lib/email/test/test_email.py index 3c382cb..317e08a 100644 --- a/Lib/email/test/test_email.py +++ b/Lib/email/test/test_email.py @@ -1859,6 +1859,14 @@ class TestMiscellaneous(unittest.TestCase): b = 'person@dom.ain' self.assertEqual(Utils.parseaddr(Utils.formataddr((a, b))), (a, b)) + def test_escape_backslashes(self): + self.assertEqual( + Utils.formataddr(('Arthur \Backslash\ Foobar', 'person@dom.ain')), + r'"Arthur \\Backslash\\ Foobar" ') + a = r'Arthur \Backslash\ Foobar' + 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" ' -- cgit v0.12