MCPcopy Index your code
hub / github.com/python/cpython / test_EncodersEncode_base64

Method test_EncodersEncode_base64

Lib/test/test_email/test_email.py:892–899  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

890class TestEncoders(unittest.TestCase):
891
892 def test_EncodersEncode_base64(self):
893 with openfile('python.gif', 'rb') as fp:
894 bindata = fp.read()
895 mimed = email.mime.image.MIMEImage(bindata)
896 base64ed = mimed.get_payload()
897 # the transfer-encoded body lines should all be <=76 characters
898 lines = base64ed.split('\n')
899 self.assertLessEqual(max([ len(x) for x in lines ]), 76)
900
901 def test_encode_empty_payload(self):
902 eq = self.assertEqual

Callers

nothing calls this directly

Calls 5

openfileFunction · 0.90
get_payloadMethod · 0.80
assertLessEqualMethod · 0.80
readMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected