summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_rfc822.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2004-09-22 17:17:32 (GMT)
committerRaymond Hettinger <python@rcn.com>2004-09-22 17:17:32 (GMT)
commitce96d8b6846f5658018923efcb8a5810bbb0bfb7 (patch)
treea3aa2a928e6ece056cd4c4c2ba897767e7257f64 /Lib/test/test_rfc822.py
parentc6646c097aceec4b4ee64968e875b508e908e9f4 (diff)
downloadcpython-ce96d8b6846f5658018923efcb8a5810bbb0bfb7.zip
cpython-ce96d8b6846f5658018923efcb8a5810bbb0bfb7.tar.gz
cpython-ce96d8b6846f5658018923efcb8a5810bbb0bfb7.tar.bz2
Bug #1030125: rfc822 __iter__ problem
Add iteration support to the Message class.
Diffstat (limited to 'Lib/test/test_rfc822.py')
-rw-r--r--Lib/test/test_rfc822.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_rfc822.py b/Lib/test/test_rfc822.py
index 491bc8a..0d9f28a 100644
--- a/Lib/test/test_rfc822.py
+++ b/Lib/test/test_rfc822.py
@@ -176,6 +176,17 @@ class MessageTestCase(unittest.TestCase):
'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@CNRI.Reston.VA.US>\n'
+ 'To: "Guido van\n'
+ '\t : Rossum" <guido@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