Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
58eb0fcb
Commit
58eb0fcb
authored
May 13, 2004
by
Barry Warsaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test_nested_inner_contains_outer_boundary(), test_nested_with_same_boundary():
Two evil samples from Anthony's MIME torture tests.
parent
d49f1d6c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
Lib/email/test/test_email.py
Lib/email/test/test_email.py
+36
-0
No files found.
Lib/email/test/test_email.py
View file @
58eb0fcb
...
...
@@ -1325,6 +1325,42 @@ hello world
msg
=
self
.
_msgobj
(
'msg_37.txt'
)
self
.
assertEqual
(
len
(
msg
.
get_payload
()),
3
)
def
test_nested_inner_contains_outer_boundary
(
self
):
eq
=
self
.
ndiffAssertEqual
# msg_38.txt has an inner part that contains outer boundaries. My
# interpretation of RFC 2046 (based on sections 5.1 and 5.1.2) say
# these are illegal and should be interpreted as unterminated inner
# parts.
msg
=
self
.
_msgobj
(
'msg_38.txt'
)
sfp
=
StringIO
()
Iterators
.
_structure
(
msg
,
sfp
)
eq
(
sfp
.
getvalue
(),
"""
\
multipart/mixed
multipart/mixed
multipart/alternative
text/plain
text/plain
text/plain
text/plain
"""
)
def
test_nested_with_same_boundary
(
self
):
eq
=
self
.
ndiffAssertEqual
# msg 39.txt is similarly evil in that it's got inner parts that use
# the same boundary as outer parts. Again, I believe the way this is
# parsed is closest to the spirit of RFC 2046
msg
=
self
.
_msgobj
(
'msg_39.txt'
)
sfp
=
StringIO
()
Iterators
.
_structure
(
msg
,
sfp
)
eq
(
sfp
.
getvalue
(),
"""
\
multipart/mixed
multipart/mixed
multipart/alternative
application/octet-stream
application/octet-stream
text/plain
"""
)
# Test some badly formatted messages
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment