File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2080,6 +2080,13 @@ def test_encode(self):
20802080
20812081# Test the Charset class
20822082class TestCharset (unittest .TestCase ):
2083+ def tearDown (self ):
2084+ from email import Charset as CharsetModule
2085+ try :
2086+ del CharsetModule .CHARSETS ['fake' ]
2087+ except KeyError :
2088+ pass
2089+
20832090 def test_idempotent (self ):
20842091 eq = self .assertEqual
20852092 # Make sure us-ascii = no Unicode conversion
@@ -2114,6 +2121,13 @@ def test_body_encode(self):
21142121 except LookupError :
21152122 # We probably don't have the Japanese codecs installed
21162123 pass
2124+ # Testing SF bug #625509, which we have to fake, since there are no
2125+ # built-in encodings where the header encoding is QP but the body
2126+ # encoding is not.
2127+ from email import Charset as CharsetModule
2128+ CharsetModule .add_charset ('fake' , CharsetModule .QP , None )
2129+ c = Charset ('fake' )
2130+ eq ('hello w\xf6 rld' , c .body_encode ('hello w\xf6 rld' ))
21172131
21182132
21192133
You can’t perform that action at this time.
0 commit comments