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
54f09490
Commit
54f09490
authored
Oct 21, 2002
by
Barry Warsaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test_body_encoding(): a new test for Charset.body_encode(), especially
one that tests the obscure bug reported in SF # 625509.
parent
46bdadc0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
Lib/email/test/test_email.py
Lib/email/test/test_email.py
+14
-0
No files found.
Lib/email/test/test_email.py
View file @
54f09490
...
...
@@ -2080,6 +2080,13 @@ two line""")
# Test the Charset class
class
TestCharset
(
unittest
.
TestCase
):
def
tearDown
(
self
):
from
email
import
Charset
as
CharsetModule
try
:
del
CharsetModule
.
CHARSETS
[
'fake'
]
except
KeyError
:
pass
def
test_idempotent
(
self
):
eq
=
self
.
assertEqual
# Make sure us-ascii = no Unicode conversion
...
...
@@ -2114,6 +2121,13 @@ class TestCharset(unittest.TestCase):
except
LookupError
:
# We probably don't have the Japanese codecs installed
pass
# Testing SF bug #625509, which we have to fake, since there are no
# built-in encodings where the header encoding is QP but the body
# encoding is not.
from
email
import
Charset
as
CharsetModule
CharsetModule
.
add_charset
(
'fake'
,
CharsetModule
.
QP
,
None
)
c
=
Charset
(
'fake'
)
eq
(
'hello w
\
xf6
rld'
,
c
.
body_encode
(
'hello w
\
xf6
rld'
))
...
...
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