(self)
| 1405 | self.assertEqual(loads(b'\x8c\x04math\x8c\x03log\x93.'), ('math', 'log')) |
| 1406 | |
| 1407 | def test_bad_ext_code(self): |
| 1408 | # unregistered extension code |
| 1409 | self.check_unpickling_error(ValueError, b'\x82\x01.') |
| 1410 | self.check_unpickling_error(ValueError, b'\x82\xff.') |
| 1411 | self.check_unpickling_error(ValueError, b'\x83\x01\x00.') |
| 1412 | self.check_unpickling_error(ValueError, b'\x83\xff\xff.') |
| 1413 | self.check_unpickling_error(ValueError, b'\x84\x01\x00\x00\x00.') |
| 1414 | self.check_unpickling_error(ValueError, b'\x84\xff\xff\xff\x7f.') |
| 1415 | # EXT specifies code <= 0 |
| 1416 | self.check_unpickling_error(pickle.UnpicklingError, b'\x82\x00.') |
| 1417 | self.check_unpickling_error(pickle.UnpicklingError, b'\x83\x00\x00.') |
| 1418 | self.check_unpickling_error(pickle.UnpicklingError, b'\x84\x00\x00\x00\x00.') |
| 1419 | self.check_unpickling_error(pickle.UnpicklingError, b'\x84\x00\x00\x00\x80.') |
| 1420 | self.check_unpickling_error(pickle.UnpicklingError, b'\x84\xff\xff\xff\xff.') |
| 1421 | |
| 1422 | @support.cpython_only |
| 1423 | def test_bad_ext_inverted_registry(self): |
nothing calls this directly
no test coverage detected