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

Method _common_test_wrapcol

Lib/test/test_base64.py:231–251  ·  view source on GitHub ↗
(self, func, data)

Source from the content-addressed store, hash-verified

229 b'-_-_')
230
231 def _common_test_wrapcol(self, func, data):
232 eq = self.assertEqual
233 expected = func(data)
234 eq(func(data, wrapcol=0), expected)
235 eq(func(data, wrapcol=80), expected)
236 eq(func(b'', wrapcol=0), func(b''))
237 eq(func(b'', wrapcol=1), func(b''))
238 eq(func(data, wrapcol=sys.maxsize), expected)
239 if check_impl_detail():
240 eq(func(data, wrapcol=sys.maxsize*2), expected)
241 with self.assertRaises(OverflowError):
242 func(data, wrapcol=2**1000)
243 with self.assertRaises(ValueError):
244 func(data, wrapcol=-80)
245 with self.assertRaises(TypeError):
246 func(data, wrapcol=80.0)
247 with self.assertRaises(TypeError):
248 func(data, wrapcol='80')
249 if func is not base64.b16encode:
250 with self.assertRaises(TypeError):
251 func(data, wrapcol=None)
252
253 def test_b64encode_wrapcol(self):
254 eq = self.assertEqual

Callers 7

Calls 4

check_impl_detailFunction · 0.90
eqFunction · 0.85
funcFunction · 0.70
assertRaisesMethod · 0.45

Tested by

no test coverage detected