diff options
author | Barry Warsaw <barry@python.org> | 2004-05-11 22:21:56 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2004-05-11 22:21:56 (GMT) |
commit | b067e6287b9c72fda50d2d1c350fc72a2c059b44 (patch) | |
tree | fd69ea8fbccaea4f4f577128213c632176136e69 /Lib | |
parent | 769f14a7c94d19f7cedf1ecf0f10497778946a31 (diff) | |
download | cpython-b067e6287b9c72fda50d2d1c350fc72a2c059b44.zip cpython-b067e6287b9c72fda50d2d1c350fc72a2c059b44.tar.gz cpython-b067e6287b9c72fda50d2d1c350fc72a2c059b44.tar.bz2 |
More boiled down tests from Anthony's big torture suite.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/email/test/test_email.py | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/Lib/email/test/test_email.py b/Lib/email/test/test_email.py index 86c5cc9..bd27960 100644 --- a/Lib/email/test/test_email.py +++ b/Lib/email/test/test_email.py @@ -1032,8 +1032,8 @@ class TestMIMEText(unittest.TestCase): -# Test a more complicated multipart/mixed type message -class TestMultipartMixed(TestEmailBase): +# Test complicated multipart/* messages +class TestMultipart(TestEmailBase): def setUp(self): fp = openfile('PyBanner048.gif') try: @@ -1305,6 +1305,26 @@ hello world ''') + def test_message_external_body(self): + eq = self.assertEqual + msg = self._msgobj('msg_36.txt') + eq(len(msg.get_payload()), 2) + msg1 = msg.get_payload(1) + eq(msg1.get_content_type(), 'multipart/alternative') + eq(len(msg1.get_payload()), 2) + for subpart in msg1.get_payload(): + eq(subpart.get_content_type(), 'message/external-body') + eq(len(subpart.get_payload()), 1) + subsubpart = subpart.get_payload(0) + eq(subsubpart.get_content_type(), 'text/plain') + + def test_double_boundary(self): + # msg_37.txt is a multipart that contains two dash-boundary's in a + # row. Our interpretation of RFC 2046 calls for ignoring the second + # and subsequent boundaries. + msg = self._msgobj('msg_37.txt') + self.assertEqual(len(msg.get_payload()), 3) + # Test some badly formatted messages @@ -1863,6 +1883,10 @@ class TestIdempotent(TestEmailBase): msg, text = self._msgobj('msg_12a.txt') self._idempotent(msg, text) + def test_message_external_body_idempotent(self): + msg, text = self._msgobj('msg_36.txt') + self._idempotent(msg, text) + def test_content_type(self): eq = self.assertEquals unless = self.failUnless |