[Python-checkins] python/dist/src/Lib/test test_rfc822.py,1.15.8.1,1.15.8.2

mwh@users.sourceforge.net mwh@users.sourceforge.net
Mon, 23 Sep 2002 06:32:55 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv27457

Modified Files:
      Tag: release22-maint
	test_rfc822.py 
Log Message:
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.


Index: test_rfc822.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_rfc822.py,v
retrieving revision 1.15.8.1
retrieving revision 1.15.8.2
diff -C2 -d -r1.15.8.1 -r1.15.8.2
*** test_rfc822.py	5 Jun 2002 19:10:19 -0000	1.15.8.1
--- test_rfc822.py	23 Sep 2002 13:32:53 -0000	1.15.8.2
***************
*** 195,198 ****
--- 195,207 ----
  
  
+     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 <cperson@dom.ain>'),
+            ('Cynthia Person', 'cperson@dom.ain'))
+ 
  def test_main():
      test_support.run_unittest(MessageTestCase)