@@ -31,6 +31,8 @@ def test_encodebytes(self):
31
31
b"YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNE"
32
32
b"RUZHSElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0\n NT"
33
33
b"Y3ODkhQCMwXiYqKCk7Ojw+LC4gW117fQ==\n " )
34
+ eq (base64 .encodebytes (b"Aladdin:open sesame" ),
35
+ b"QWxhZGRpbjpvcGVuIHNlc2FtZQ==\n " )
34
36
# Non-bytes
35
37
eq (base64 .encodebytes (bytearray (b'abc' )), b'YWJj\n ' )
36
38
eq (base64 .encodebytes (memoryview (b'abc' )), b'YWJj\n ' )
@@ -50,6 +52,8 @@ def test_decodebytes(self):
50
52
b"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
51
53
b"0123456789!@#0^&*();:<>,. []{}" )
52
54
eq (base64 .decodebytes (b'' ), b'' )
55
+ eq (base64 .decodebytes (b"QWxhZGRpbjpvcGVuIHNlc2FtZQ==\n " ),
56
+ b"Aladdin:open sesame" )
53
57
# Non-bytes
54
58
eq (base64 .decodebytes (bytearray (b'YWJj\n ' )), b'abc' )
55
59
eq (base64 .decodebytes (memoryview (b'YWJj\n ' )), b'abc' )
@@ -762,14 +766,6 @@ def tearDown(self):
762
766
def get_output (self , * args ):
763
767
return script_helper .assert_python_ok ('-m' , 'base64' , * args ).out
764
768
765
- def test_encode_decode (self ):
766
- output = self .get_output ('-t' )
767
- self .assertSequenceEqual (output .splitlines (), (
768
- b"b'Aladdin:open sesame'" ,
769
- br"b'QWxhZGRpbjpvcGVuIHNlc2FtZQ==\n'" ,
770
- b"b'Aladdin:open sesame'" ,
771
- ))
772
-
773
769
def test_encode_file (self ):
774
770
with open (os_helper .TESTFN , 'wb' ) as fp :
775
771
fp .write (b'a\xff b\n ' )
0 commit comments