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

Method _common_test_wrapcol

Lib/test/test_binascii.py:547–567  ·  view source on GitHub ↗
(self, func)

Source from the content-addressed store, hash-verified

545 assertInvalidChar(b"xxxB\nP\thU'D v/F+", ignorechars=b" \n\tv")
546
547 def _common_test_wrapcol(self, func):
548 eq = self.assertEqual
549 data = self.data
550 expected = func(data)
551 eq(func(data, wrapcol=0), expected)
552 eq(func(data, wrapcol=8000), expected)
553 eq(func(b'', wrapcol=0), func(b''))
554 eq(func(b'', wrapcol=1), func(b''))
555 eq(func(data, wrapcol=sys.maxsize), expected)
556 if check_impl_detail():
557 eq(func(data, wrapcol=sys.maxsize*2), expected)
558 with self.assertRaises(OverflowError):
559 func(data, wrapcol=2**1000)
560 with self.assertRaises(ValueError):
561 func(data, wrapcol=-80)
562 with self.assertRaises(TypeError):
563 func(data, wrapcol=80.0)
564 with self.assertRaises(TypeError):
565 func(data, wrapcol='80')
566 with self.assertRaises(TypeError):
567 func(data, wrapcol=None)
568
569 def test_ascii85_wrapcol(self):
570 # Test Ascii85 splitting lines

Callers 4

test_ascii85_wrapcolMethod · 0.95
test_base85_wrapcolMethod · 0.95
test_base32_wrapcolMethod · 0.95

Calls 4

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

Tested by

no test coverage detected