mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
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.
This commit is contained in:
parent
bb4e859ecf
commit
932874df39
1 changed files with 19 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue