(self)
| 3309 | self.assertTrue(num_appends >= 2) |
| 3310 | |
| 3311 | def test_dict_chunking(self): |
| 3312 | n = 10 # too small to chunk |
| 3313 | x = dict.fromkeys(range(n)) |
| 3314 | for proto in protocols: |
| 3315 | s = self.dumps(x, proto) |
| 3316 | self.assertIsInstance(s, bytes_types) |
| 3317 | y = self.loads(s) |
| 3318 | self.assert_is_copy(x, y) |
| 3319 | num_setitems = count_opcode(pickle.SETITEMS, s) |
| 3320 | self.assertEqual(num_setitems, proto > 0) |
| 3321 | |
| 3322 | n = 2500 # expect at least two chunks when proto > 0 |
| 3323 | x = dict.fromkeys(range(n)) |
| 3324 | for proto in protocols: |
| 3325 | s = self.dumps(x, proto) |
| 3326 | y = self.loads(s) |
| 3327 | self.assert_is_copy(x, y) |
| 3328 | num_setitems = count_opcode(pickle.SETITEMS, s) |
| 3329 | if proto == 0: |
| 3330 | self.assertEqual(num_setitems, 0) |
| 3331 | else: |
| 3332 | self.assertTrue(num_setitems >= 2) |
| 3333 | |
| 3334 | def test_set_chunking(self): |
| 3335 | n = 10 # too small to chunk |
nothing calls this directly
no test coverage detected