[Python-checkins] python/dist/src/Lib/test test_rfc822.py, 1.21, 1.22

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Wed Sep 22 19:17:35 CEST 2004


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18184/Lib/test

Modified Files:
	test_rfc822.py 
Log Message:
Bug #1030125:  rfc822 __iter__ problem

Add iteration support to the Message class.



Index: test_rfc822.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_rfc822.py,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- test_rfc822.py	7 Aug 2004 16:38:40 -0000	1.21
+++ test_rfc822.py	22 Sep 2004 17:17:32 -0000	1.22
@@ -176,6 +176,17 @@
             'foo',
             [('', 'guido@[132.151.1.21]')])
 
+    def test_iter(self):
+        m = rfc822.Message(StringIO(
+            'Date:    Wed, 13 Jan 1999 23:57:35 -0500\n'
+            'From:    Guido van Rossum <guido at CNRI.Reston.VA.US>\n'
+            'To:      "Guido van\n'
+            '\t : Rossum" <guido at python.org>\n'
+            'Subject: test2\n'
+            '\n'
+            'test2\n' ))
+        self.assertEqual(sorted(m), ['date', 'from', 'subject', 'to'])
+
     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



More information about the Python-checkins mailing list