(self)
| 3287 | self.produce_global_ext(0x12abcdef, pickle.EXT4) # check endianness |
| 3288 | |
| 3289 | def test_list_chunking(self): |
| 3290 | n = 10 # too small to chunk |
| 3291 | x = list(range(n)) |
| 3292 | for proto in protocols: |
| 3293 | s = self.dumps(x, proto) |
| 3294 | y = self.loads(s) |
| 3295 | self.assert_is_copy(x, y) |
| 3296 | num_appends = count_opcode(pickle.APPENDS, s) |
| 3297 | self.assertEqual(num_appends, proto > 0) |
| 3298 | |
| 3299 | n = 2500 # expect at least two chunks when proto > 0 |
| 3300 | x = list(range(n)) |
| 3301 | for proto in protocols: |
| 3302 | s = self.dumps(x, proto) |
| 3303 | y = self.loads(s) |
| 3304 | self.assert_is_copy(x, y) |
| 3305 | num_appends = count_opcode(pickle.APPENDS, s) |
| 3306 | if proto == 0: |
| 3307 | self.assertEqual(num_appends, 0) |
| 3308 | else: |
| 3309 | self.assertTrue(num_appends >= 2) |
| 3310 | |
| 3311 | def test_dict_chunking(self): |
| 3312 | n = 10 # too small to chunk |
nothing calls this directly
no test coverage detected