[Python-checkins] python/dist/src/Lib/email/test test_email.py,1.41,1.42

bwarsaw@users.sourceforge.net bwarsaw@users.sourceforge.net
Mon, 10 Mar 2003 11:18:48 -0800


Update of /cvsroot/python/python/dist/src/Lib/email/test
In directory sc8-pr-cvs1:/tmp/cvs-serv23679

Modified Files:
	test_email.py 
Log Message:
test_escape_backslashes(): A test for SF bug #663369 by Matthew Woodcraft.


Index: test_email.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/email/test/test_email.py,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -d -r1.41 -r1.42
*** test_email.py	10 Mar 2003 17:00:43 -0000	1.41
--- test_email.py	10 Mar 2003 19:18:34 -0000	1.42
***************
*** 1860,1863 ****
--- 1860,1871 ----
          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" <person@dom.ain>')
+         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 <jxd@example.com>'