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
10627ba9
Commit
10627ba9
authored
Mar 06, 2003
by
Barry Warsaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge of the folding-reimpl-branch. Specific changes,
Update tests for email 2.5.
parent
e899e51c
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
165 additions
and
76 deletions
+165
-76
Lib/email/test/test_email.py
Lib/email/test/test_email.py
+151
-58
Lib/email/test/test_email_codecs.py
Lib/email/test/test_email_codecs.py
+14
-18
No files found.
Lib/email/test/test_email.py
View file @
10627ba9
This diff is collapsed.
Click to expand it.
Lib/email/test/test_email_codecs.py
View file @
10627ba9
...
...
@@ -26,7 +26,14 @@ class TestEmailAsianCodecs(TestEmailBase):
ghello
=
'Gr
\
xfc
\
xdf
Gott!'
h
.
append
(
jhello
,
j
)
h
.
append
(
ghello
,
g
)
eq
(
h
.
encode
(),
'Hello World! =?iso-2022-jp?b?GyRCJU8lbSE8JW8hPCVrJUkhKhsoQg==?=
\
n
=?iso-8859-1?q?Gr=FC=DF_Gott!?='
)
# BAW: This used to -- and maybe should -- fold the two iso-8859-1
# chunks into a single encoded word. However it doesn't violate the
# standard to have them as two encoded chunks and maybe it's
# reasonable <wink> for each .append() call to result in a separate
# encoded word.
eq
(
h
.
encode
(),
"""
\
Hello World! =?iso-2022-jp?b?GyRCJU8lbSE8JW8hPCVrJUkhKhsoQg==?=
=?iso-8859-1?q?Gr=FC=DF?= =?iso-8859-1?q?_Gott!?="""
)
eq
(
decode_header
(
h
.
encode
()),
[(
'Hello World!'
,
None
),
(
'
\
x1b
$B%O%m!<%o!<%k%I!*
\
x1b
(B'
,
'iso-2022-jp'
),
...
...
@@ -35,23 +42,12 @@ class TestEmailAsianCodecs(TestEmailBase):
h
=
Header
(
long
,
j
,
header_name
=
"Subject"
)
# test a very long header
enc
=
h
.
encode
()
# BAW: The following used to pass. Sadly, the test afterwards is what
# happens now. I've no idea which is right. Please, any Japanese and
# RFC 2047 experts, please verify!
## eq(enc, '''\
##=?iso-2022-jp?b?dGVzdC1qYSAbJEIkWEVqOUYkNSRsJD8lYRsoQg==?=
## =?iso-2022-jp?b?GyRCITwlayRPO0oycTxUJE4+NRsoQg==?=
## =?iso-2022-jp?b?GyRCRyckckJUJEMkRiQkJF4kORsoQg==?=''')
eq
(
enc
,
"""
\
=?iso-2022-jp?b?dGVzdC1qYSAbJEIkWEVqOUYkNSRsJD8lYRsoQg==?=
=?iso-2022-jp?b?GyRCITwlayRPO0oycTxUJE4+NUcnJHJCVCRDJEYkJCReJDkbKEI=?="""
)
# BAW: same deal here. :(
## self.assertEqual(
## decode_header(enc),
## [("test-ja \x1b$B$XEj9F$5$l$?%a\x1b(B\x1b$B!<%k$O;J2q<T$N>5\x1b(B\x1b$BG'$rBT$C$F$$$^$9\x1b(B", 'iso-2022-jp')])
self
.
assertEqual
(
decode_header
(
enc
),
[(
"test-ja
\
x1b
$B$XEj9F$5$l$?%a
\
x1b
(B
\
x1b
$B!<%k$O;J2q<T$N>5G'$rBT$C$F$$$^$9
\
x1b
(B"
,
'iso-2022-jp'
)])
# TK: splitting point may differ by codec design and/or Header encoding
eq
(
enc
,
"""
\
=?iso-2022-jp?b?dGVzdC1qYSAbJEIkWEVqOUYkNSRsJD8lYSE8JWskTztKGyhC?=
=?iso-2022-jp?b?GyRCMnE8VCROPjVHJyRyQlQkQyRGJCQkXiQ5GyhC?="""
)
# TK: full decode comparison
eq
(
h
.
__unicode__
().
encode
(
'euc-jp'
),
long
)
...
...
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