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
9ef9ed16
Commit
9ef9ed16
authored
Apr 07, 2011
by
R David Murray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve test coverage of _split_ascii method.
parent
7ab08d7b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
0 deletions
+43
-0
Lib/email/test/test_email.py
Lib/email/test/test_email.py
+43
-0
No files found.
Lib/email/test/test_email.py
View file @
9ef9ed16
...
...
@@ -750,6 +750,49 @@ References: <0@dom.ain> <1@dom.ain> <2@dom.ain> <3@dom.ain> <4@dom.ain>
Test"""
)
def
test_last_split_chunk_does_not_fit
(
self
):
eq
=
self
.
ndiffAssertEqual
h
=
Header
(
'Subject: the first part of this is short, but_the_second'
'_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line'
'_all_by_itself'
)
eq
(
h
.
encode
(),
"""
\
Subject: the first part of this is short,
but_the_second_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line_all_by_itself"""
)
def
test_splittable_leading_char_followed_by_overlong_unsplitable
(
self
):
eq
=
self
.
ndiffAssertEqual
h
=
Header
(
', but_the_second'
'_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line'
'_all_by_itself'
)
eq
(
h
.
encode
(),
"""
\
,
but_the_second_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line_all_by_itself"""
)
def
test_multiple_splittable_leading_char_followed_by_overlong_unsplitable
(
self
):
eq
=
self
.
ndiffAssertEqual
h
=
Header
(
', , but_the_second'
'_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line'
'_all_by_itself'
)
eq
(
h
.
encode
(),
"""
\
, ,
but_the_second_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line_all_by_itself"""
)
def
test_trailing_splitable_on_overlong_unsplitable
(
self
):
eq
=
self
.
ndiffAssertEqual
h
=
Header
(
'this_part_does_not_fit_within_maxlinelen_and_thus_should_'
'be_on_a_line_all_by_itself;'
)
eq
(
h
.
encode
(),
"this_part_does_not_fit_within_maxlinelen_and_thus_should_"
"be_on_a_line_all_by_itself;"
)
def
test_trailing_splitable_on_overlong_unsplitable_with_leading_splitable
(
self
):
eq
=
self
.
ndiffAssertEqual
h
=
Header
(
'; '
'this_part_does_not_fit_within_maxlinelen_and_thus_should_'
'be_on_a_line_all_by_itself;'
)
eq
(
h
.
encode
(),
"""
\
;
this_part_does_not_fit_within_maxlinelen_and_thus_should_be_on_a_line_all_by_itself;"""
)
def
test_no_split_long_header
(
self
):
eq
=
self
.
ndiffAssertEqual
hstr
=
'References: '
+
'x'
*
80
...
...
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