(self)
| 3575 | self.assertTrue(num_appends >= 2) |
| 3576 | |
| 3577 | def test_dict_chunking(self): |
| 3578 | n = 10 # too small to chunk |
| 3579 | x = dict.fromkeys(range(n)) |
| 3580 | for proto in protocols: |
| 3581 | s = self.dumps(x, proto) |
| 3582 | self.assertIsInstance(s, bytes_types) |
| 3583 | y = self.loads(s) |
| 3584 | self.assert_is_copy(x, y) |
| 3585 | num_setitems = count_opcode(pickle.SETITEMS, s) |
| 3586 | self.assertEqual(num_setitems, proto > 0) |
| 3587 | |
| 3588 | n = 2500 # expect at least two chunks when proto > 0 |
| 3589 | x = dict.fromkeys(range(n)) |
| 3590 | for proto in protocols: |
| 3591 | s = self.dumps(x, proto) |
| 3592 | y = self.loads(s) |
| 3593 | self.assert_is_copy(x, y) |
| 3594 | num_setitems = count_opcode(pickle.SETITEMS, s) |
| 3595 | if proto == 0: |
| 3596 | self.assertEqual(num_setitems, 0) |
| 3597 | else: |
| 3598 | self.assertTrue(num_setitems >= 2) |
| 3599 | |
| 3600 | def test_set_chunking(self): |
| 3601 | n = 10 # too small to chunk |
nothing calls this directly
no test coverage detected