diff options
| author | Barry Warsaw <barry@python.org> | 2004-11-06 00:04:20 +0000 |
|---|---|---|
| committer | Barry Warsaw <barry@python.org> | 2004-11-06 00:04:20 +0000 |
| commit | 932874df396781e7b72dbae351e1c08f563e3fb0 (patch) | |
| tree | ba0d0846e02b101e76be1cb7cbc0724e88a54fda /Lib/email/test | |
| parent | bb4e859ecfd8d8122c879435f7836377293b7e50 (diff) | |
| download | cpython-git-932874df396781e7b72dbae351e1c08f563e3fb0.tar.gz | |
test_boundary_with_leading_space(): Test case for SF bug #1060941. RFC 2046
says boundaries may begin -- but not end -- with whitespace.
I will backport to Python 2.3.
Diffstat (limited to 'Lib/email/test')
| -rw-r--r-- | Lib/email/test/test_email.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Lib/email/test/test_email.py b/Lib/email/test/test_email.py index 745260ed98..2fcd859ab8 100644 --- a/Lib/email/test/test_email.py +++ b/Lib/email/test/test_email.py @@ -1332,6 +1332,25 @@ Content-Transfer-Encoding: 7Bit ----961284236552522269-- ''') + def test_boundary_with_leading_space(self): + eq = self.assertEqual + msg = email.message_from_string('''\ +MIME-Version: 1.0 +Content-Type: multipart/mixed; boundary=" XXXX" + +-- XXXX +Content-Type: text/plain + + +-- XXXX +Content-Type: text/plain + +-- XXXX-- +''') + self.failUnless(msg.is_multipart()) + eq(msg.get_boundary(), ' XXXX') + eq(len(msg.get_payload()), 2) + # Test some badly formatted messages |
