MCPcopy Create free account
hub / github.com/python/cpython / test_b2a_base64_wrapcol

Method test_b2a_base64_wrapcol

Lib/test/test_binascii.py:1324–1336  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1322 self.assertEqual(b2a_base64(t(b'abc'), padded=False), b'YWJj\n')
1323
1324 def test_b2a_base64_wrapcol(self):
1325 self._common_test_wrapcol(binascii.b2a_base64)
1326 b = self.type2test(b'www.python.org')
1327 self.assertEqual(binascii.b2a_base64(b, wrapcol=8),
1328 b'd3d3LnB5\ndGhvbi5v\ncmc=\n')
1329 self.assertEqual(binascii.b2a_base64(b, wrapcol=11),
1330 b'd3d3LnB5\ndGhvbi5v\ncmc=\n')
1331 self.assertEqual(binascii.b2a_base64(b, wrapcol=8, newline=False),
1332 b'd3d3LnB5\ndGhvbi5v\ncmc=')
1333 self.assertEqual(binascii.b2a_base64(b, wrapcol=1),
1334 b'd3d3\nLnB5\ndGhv\nbi5v\ncmc=\n')
1335 b = self.type2test(b'')
1336 self.assertEqual(binascii.b2a_base64(b, wrapcol=8, newline=False), b'')
1337
1338 @hypothesis.given(
1339 binary=hypothesis.strategies.binary(),

Callers

nothing calls this directly

Calls 3

_common_test_wrapcolMethod · 0.95
type2testMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected