code: def test_encodebytes(self):
      eq = self.assertEqual
      eq(
          base64.encodebytes(b"www.python.org"),
          b"d3d3LnB5dGhvbi5vcmc=\n",
      )
      eq(base64.encodebytes(b"a"), b"YQ==\n")
      eq(base64.encodebytes(b"ab"), b"YWI=\n")
      eq(base64.encodebytes(b"abc"), b"YWJj\n")
      eq(base64.encodebytes(b""), b"")
      eq(
          base64.encodebytes(
              b"abcdefghijklmnopqrstuvwxyz"
              b"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
              b"0123456789!@#0^&*();:<>,. []{}"
          ),
          b"YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNE"
          b"RUZHSElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0\nNT"
          b"Y3ODkhQCMwXiYqKCk7Ojw+LC4gW117fQ==\n",
      )
      eq(
          base64.encodebytes(b"Aladdin:open sesame"),
          b"QWxhZGRpbjpvcGVuIHNlc2FtZQ==\n",
      )
      # Non-bytes
      eq(base64.encodebytes(bytearray(b"abc")), b"YWJj\n")
      eq(base64.encodebytes(memoryview(b"abc")), b"YWJj\n")
      eq(base64.encodebytes(array("B", b"abc")), b"YWJj\n")
      self.check_type_errors(base64.encodebytes)
  
imports: import unittest
  import base64
  import binascii
  import os
  from array import array
  from test.support import os_helper
  from test.support import script_helper
label_desc: Use image node_id 2 for calling the LegacyBase64TestCase obj's underlying member method code with example usage: obj.test_encodebytes() without return types