Lines Matching refs:b64encode
108 self.check_nonbyte_element_format(base64.b64encode, bytes_data)
109 self.check_multidimensional(base64.b64encode, bytes_data)
128 eq(base64.b64encode(b"www.python.org"), b"d3d3LnB5dGhvbi5vcmc=")
129 eq(base64.b64encode(b'\x00'), b'AA==')
130 eq(base64.b64encode(b"a"), b"YQ==")
131 eq(base64.b64encode(b"ab"), b"YWI=")
132 eq(base64.b64encode(b"abc"), b"YWJj")
133 eq(base64.b64encode(b""), b"")
134 eq(base64.b64encode(b"abcdefghijklmnopqrstuvwxyz"
141 eq(base64.b64encode(b'\xd3V\xbeo\xf7\x1d', altchars=b'*$'), b'01a*b$cd')
142 eq(base64.b64encode(b'\xd3V\xbeo\xf7\x1d', altchars=bytearray(b'*$')),
144 eq(base64.b64encode(b'\xd3V\xbeo\xf7\x1d', altchars=memoryview(b'*$')),
146 eq(base64.b64encode(b'\xd3V\xbeo\xf7\x1d', altchars=array('B', b'*$')),
149 self.check_other_types(base64.b64encode, b'abcd', b'YWJjZA==')
150 self.check_encode_type_errors(base64.b64encode)
151 self.assertRaises(TypeError, base64.b64encode, b"", altchars="*$")
719 b64encode = base64.b64encode
724 self.assertEqual(b64encode(b""), b"")
725 self.assertEqual(b64encode(b"f"), b"Zg==")
726 self.assertEqual(b64encode(b"fo"), b"Zm8=")
727 self.assertEqual(b64encode(b"foo"), b"Zm9v")
728 self.assertEqual(b64encode(b"foob"), b"Zm9vYg==")
729 self.assertEqual(b64encode(b"fooba"), b"Zm9vYmE=")
730 self.assertEqual(b64encode(b"foobar"), b"Zm9vYmFy")