Skip to content

Commit b4ee044

Browse files
committed
Update test_base64.py from CPython v3.12.0
1 parent df98264 commit b4ee044

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

Lib/test/test_base64.py

+4-8
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ def test_encodebytes(self):
3131
b"YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNE"
3232
b"RUZHSElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0\nNT"
3333
b"Y3ODkhQCMwXiYqKCk7Ojw+LC4gW117fQ==\n")
34+
eq(base64.encodebytes(b"Aladdin:open sesame"),
35+
b"QWxhZGRpbjpvcGVuIHNlc2FtZQ==\n")
3436
# Non-bytes
3537
eq(base64.encodebytes(bytearray(b'abc')), b'YWJj\n')
3638
eq(base64.encodebytes(memoryview(b'abc')), b'YWJj\n')
@@ -50,6 +52,8 @@ def test_decodebytes(self):
5052
b"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
5153
b"0123456789!@#0^&*();:<>,. []{}")
5254
eq(base64.decodebytes(b''), b'')
55+
eq(base64.decodebytes(b"QWxhZGRpbjpvcGVuIHNlc2FtZQ==\n"),
56+
b"Aladdin:open sesame")
5357
# Non-bytes
5458
eq(base64.decodebytes(bytearray(b'YWJj\n')), b'abc')
5559
eq(base64.decodebytes(memoryview(b'YWJj\n')), b'abc')
@@ -762,14 +766,6 @@ def tearDown(self):
762766
def get_output(self, *args):
763767
return script_helper.assert_python_ok('-m', 'base64', *args).out
764768

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-
773769
def test_encode_file(self):
774770
with open(os_helper.TESTFN, 'wb') as fp:
775771
fp.write(b'a\xffb\n')

0 commit comments

Comments
 (0)