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
fd09d0a8
Commit
fd09d0a8
authored
May 11, 2004
by
Barry Warsaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More boiled down tests from Anthony's big torture suite.
parent
192fa041
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
2 deletions
+26
-2
Lib/email/test/test_email.py
Lib/email/test/test_email.py
+26
-2
No files found.
Lib/email/test/test_email.py
View file @
fd09d0a8
...
...
@@ -1032,8 +1032,8 @@ class TestMIMEText(unittest.TestCase):
# Test
a more complicated multipart/mixed type message
class
TestMultipart
Mixed
(
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
...
...
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