@@ -2555,7 +2555,6 @@ def test_encode(self):
25552555 eq (base64mime .body_encode ('hello' ), 'aGVsbG8=\n ' )
25562556 # Test the binary flag
25572557 eq (base64mime .body_encode ('hello\n ' ), 'aGVsbG8K\n ' )
2558- eq (base64mime .body_encode ('hello\n ' , 0 ), 'aGVsbG8NCg==\n ' )
25592558 # Test the maxlinelen arg
25602559 eq (base64mime .body_encode ('xxxx ' * 20 , maxlinelen = 40 ), """\
25612560 eHh4eCB4eHh4IHh4eHggeHh4eCB4eHh4IHh4eHgg
@@ -2564,7 +2563,8 @@ def test_encode(self):
25642563eHh4eCB4eHh4IA==
25652564""" )
25662565 # Test the eol argument
2567- eq (base64mime .encode ('xxxx ' * 20 , maxlinelen = 40 , eol = '\r \n ' ), """\
2566+ eq (base64mime .body_encode ('xxxx ' * 20 , maxlinelen = 40 , eol = '\r \n ' ),
2567+ """\
25682568 eHh4eCB4eHh4IHh4eHggeHh4eCB4eHh4IHh4eHgg\r
25692569eHh4eCB4eHh4IHh4eHggeHh4eCB4eHh4IHh4eHgg\r
25702570eHh4eCB4eHh4IHh4eHggeHh4eCB4eHh4IHh4eHgg\r
@@ -2681,7 +2681,6 @@ def test_encode(self):
26812681 eq (quoprimime .body_encode ('hello' ), 'hello' )
26822682 # Test the binary flag
26832683 eq (quoprimime .body_encode ('hello\r \n world' ), 'hello\n world' )
2684- eq (quoprimime .body_encode ('hello\r \n world' , 0 ), 'hello\n world' )
26852684 # Test the maxlinelen arg
26862685 eq (quoprimime .body_encode ('xxxx ' * 20 , maxlinelen = 40 ), """\
26872686 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx=
@@ -2727,21 +2726,21 @@ def test_body_encode(self):
27272726 eq = self .assertEqual
27282727 # Try a charset with QP body encoding
27292728 c = Charset ('iso-8859-1' )
2730- eq ('hello w=F6rld' , c .body_encode (b 'hello w\xf6 rld' ))
2729+ eq ('hello w=F6rld' , c .body_encode ('hello w\xf6 rld' ))
27312730 # Try a charset with Base64 body encoding
27322731 c = Charset ('utf-8' )
2733- eq ('aGVsbG8gd29ybGQ=\n ' , c .body_encode (b 'hello world' ))
2732+ eq ('aGVsbG8gd29ybGQ=\n ' , c .body_encode ('hello world' ))
27342733 # Try a charset with None body encoding
27352734 c = Charset ('us-ascii' )
2736- eq ('hello world' , c .body_encode (b 'hello world' ))
2735+ eq ('hello world' , c .body_encode ('hello world' ))
27372736 # Try the convert argument, where input codec != output codec
27382737 c = Charset ('euc-jp' )
27392738 # With apologies to Tokio Kikuchi ;)
27402739 try :
27412740 eq ('\x1b $B5FCO;~IW\x1b (B' ,
2742- c .body_encode (b '\xb5 \xc6 \xc3 \xcf \xbb \xfe \xc9 \xd7 ' ))
2741+ c .body_encode ('\xb5 \xc6 \xc3 \xcf \xbb \xfe \xc9 \xd7 ' ))
27432742 eq ('\xb5 \xc6 \xc3 \xcf \xbb \xfe \xc9 \xd7 ' ,
2744- c .body_encode (b '\xb5 \xc6 \xc3 \xcf \xbb \xfe \xc9 \xd7 ' , False ))
2743+ c .body_encode ('\xb5 \xc6 \xc3 \xcf \xbb \xfe \xc9 \xd7 ' , False ))
27452744 except LookupError :
27462745 # We probably don't have the Japanese codecs installed
27472746 pass
@@ -2751,7 +2750,7 @@ def test_body_encode(self):
27512750 from email import charset as CharsetModule
27522751 CharsetModule .add_charset ('fake' , CharsetModule .QP , None )
27532752 c = Charset ('fake' )
2754- eq ('hello w\xf6 rld' , c .body_encode (b 'hello w\xf6 rld' ))
2753+ eq ('hello w\xf6 rld' , c .body_encode ('hello w\xf6 rld' ))
27552754
27562755 def test_unicode_charset_name (self ):
27572756 charset = Charset ('us-ascii' )
0 commit comments