(self, func, data)
| 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 |
no test coverage detected