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
d1de6eac
Commit
d1de6eac
authored
Oct 04, 2001
by
Barry Warsaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TestIterators: Tim Peters suggests a more succinct spelling of
"listify an iterator".
parent
c4496f88
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
12 deletions
+4
-12
Lib/test/test_email.py
Lib/test/test_email.py
+4
-12
No files found.
Lib/test/test_email.py
View file @
d1de6eac
...
...
@@ -793,17 +793,13 @@ class TestIterators(TestEmailBase):
# First a simple non-multipart message
msg
=
self
.
_msgobj
(
'msg_01.txt'
)
it
=
Iterators
.
body_line_iterator
(
msg
)
lines
=
[]
for
line
in
it
:
lines
.
append
(
line
)
lines
=
list
(
it
)
eq
(
len
(
lines
),
6
)
eq
(
EMPTYSTRING
.
join
(
lines
),
msg
.
get_payload
())
# Now a more complicated multipart
msg
=
self
.
_msgobj
(
'msg_02.txt'
)
it
=
Iterators
.
body_line_iterator
(
msg
)
lines
=
[]
for
line
in
it
:
lines
.
append
(
line
)
lines
=
list
(
it
)
eq
(
len
(
lines
),
43
)
eq
(
EMPTYSTRING
.
join
(
lines
),
openfile
(
'msg_19.txt'
).
read
())
...
...
@@ -811,12 +807,8 @@ class TestIterators(TestEmailBase):
eq
=
self
.
assertEqual
msg
=
self
.
_msgobj
(
'msg_04.txt'
)
it
=
Iterators
.
typed_subpart_iterator
(
msg
,
'text'
)
lines
=
[]
subparts
=
0
for
subpart
in
it
:
subparts
+=
1
lines
.
append
(
subpart
.
get_payload
())
eq
(
subparts
,
2
)
lines
=
[
subpart
.
get_payload
()
for
subpart
in
it
]
eq
(
len
(
lines
),
2
)
eq
(
EMPTYSTRING
.
join
(
lines
),
"""
\
a simple kind of mirror
to reflect upon our own
...
...
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