[Python-checkins] CVS: python/dist/src/Lib/test test_rfc822.py,1.11,1.12

Barry Warsaw bwarsaw@users.sourceforge.net
2001年7月16日 13:44:18 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv30376
Modified Files:
	test_rfc822.py 
Log Message:
test_basic(): Add a test for "person@dom.ain (User J. Person)" which
was already correctly parsed (contrary to a comment in Mailman).
test_rfc2822_phrases(): RFC 2822 now requires that we allow `.' in
phrases, which means we must accept dots in unquoted realname parts.
Add a test to check the change in rfc822.py 1.58.
Index: test_rfc822.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_rfc822.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** test_rfc822.py	2001年05月22日 19:38:31	1.11
--- test_rfc822.py	2001年07月16日 20:44:16	1.12
***************
*** 118,121 ****
--- 118,125 ----
 ])
 
+ self.check(
+ 'To: person@dom.ain (User J. Person)\n\n',
+ [('User J. Person', 'person@dom.ain')])
+ 
 def test_twisted(self):
 # This one is just twisted. I don't know what the proper
***************
*** 165,168 ****
--- 169,180 ----
 [('', 'guido@[132.151.1.21]')])
 
+ def test_rfc2822_phrases(self):
+ # RFC 2822 (the update to RFC 822) specifies that dots in phrases are
+ # obsolete syntax, which conforming programs MUST recognize but NEVER
+ # generate (see 4ドル.1 Miscellaneous obsolete tokens). This is a
+ # departure from RFC 822 which did not allow dots in non-quoted
+ # phrases.
+ self.check('To: User J. Person <person@dom.ain>\n\n',
+ [('User J. Person', 'person@dom.ain')])
 
 test_support.run_unittest(MessageTestCase)

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