[Python-checkins] python/dist/src/Lib/test test_rfc822.py,1.16,1.17

bwarsaw@sourceforge.net bwarsaw@sourceforge.net
2002年5月22日 20:21:03 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv3068/Lib/test
Modified Files:
	test_rfc822.py 
Log Message:
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.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** test_rfc822.py	21 May 2002 19:46:13 -0000	1.16
--- test_rfc822.py	23 May 2002 03:21:01 -0000	1.17
***************
*** 214,217 ****
--- 214,226 ----
 eq(addrs, ccs)
 
+ 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)

AltStyle によって変換されたページ (->オリジナル) /