summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_rfc822.py
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2006-05-01 03:03:02 (GMT)
committerBarry Warsaw <barry@python.org>2006-05-01 03:03:02 (GMT)
commitdbcc8d9b24496ca55dd349cd2eb5273cf6723343 (patch)
tree3db32de8b91c37685d38008263918773fcc41a39 /Lib/test/test_rfc822.py
parent09612281efc664a7705014349791cbfbb7af15bc (diff)
downloadcpython-dbcc8d9b24496ca55dd349cd2eb5273cf6723343.zip
cpython-dbcc8d9b24496ca55dd349cd2eb5273cf6723343.tar.gz
cpython-dbcc8d9b24496ca55dd349cd2eb5273cf6723343.tar.bz2
Port forward from 2.4 branch:
Patch #1464708 from William McVey: fixed handling of nested comments in mail addresses. E.g. "Foo ((Foo Bar)) <foo@example.com>" Fixes for both rfc822.py and email package. This patch needs to be back ported to Python 2.3 for email 2.5.
Diffstat (limited to 'Lib/test/test_rfc822.py')
-rw-r--r--Lib/test/test_rfc822.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_rfc822.py b/Lib/test/test_rfc822.py
index 0d9f28a..6d22825 100644
--- a/Lib/test/test_rfc822.py
+++ b/Lib/test/test_rfc822.py
@@ -45,6 +45,10 @@ class MessageTestCase(unittest.TestCase):
print 'extra parsed address:', repr(n), repr(a)
continue
i = i + 1
+ self.assertEqual(mn, n,
+ "Un-expected name: %s != %s" % (`mn`, `n`))
+ self.assertEqual(ma, a,
+ "Un-expected address: %s != %s" % (`ma`, `a`))
if mn == n and ma == a:
pass
else:
@@ -129,6 +133,12 @@ class MessageTestCase(unittest.TestCase):
'To: person@dom.ain (User J. Person)\n\n',
[('User J. Person', 'person@dom.ain')])
+ def test_doublecomment(self):
+ # The RFC allows comments within comments in an email addr
+ self.check(
+ 'To: person@dom.ain ((User J. Person)), John Doe <foo@bar.com>\n\n',
+ [('User J. Person', 'person@dom.ain'), ('John Doe', 'foo@bar.com')])
+
def test_twisted(self):
# This one is just twisted. I don't know what the proper
# result should be, but it shouldn't be to infloop, which is