]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
test_rfc2047_multiline(): Test case for SF bug #640110.
authorBarry Warsaw <barry@python.org>
Thu, 6 Mar 2003 06:38:29 +0000 (06:38 +0000)
committerBarry Warsaw <barry@python.org>
Thu, 6 Mar 2003 06:38:29 +0000 (06:38 +0000)
Lib/email/test/test_email.py

index 0ffc9574e0d69e0e9c99393a5f6ecc9ea303ede2..542ddcda645765139601d2865b64d3b73d86b280 100644 (file)
@@ -1193,6 +1193,20 @@ class TestRFC2047(unittest.TestCase):
         eq(Utils.encode(s2, charset='iso-8859-2', encoding='b'),
            '=?iso-8859-2?b?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=')
 
+    def test_rfc2047_multiline(self):
+        eq = self.assertEqual
+        s = """Re: =?mac-iceland?q?r=8Aksm=9Arg=8Cs?= baz
+ foo bar =?mac-iceland?q?r=8Aksm=9Arg=8Cs?="""
+        dh = decode_header(s)
+        eq(dh, [
+            ('Re:', None),
+            ('r\x8aksm\x9arg\x8cs', 'mac-iceland'),
+            ('baz foo bar', None),
+            ('r\x8aksm\x9arg\x8cs', 'mac-iceland')])
+        eq(str(make_header(dh)),
+           """Re: =?mac-iceland?q?r=8Aksm=9Arg=8Cs?= baz foo bar
+ =?mac-iceland?q?r=8Aksm=9Arg=8Cs?=""")
+
 
 \f
 # Test the MIMEMessage class