(self)
| 3332 | self.assertTrue(num_setitems >= 2) |
| 3333 | |
| 3334 | def test_set_chunking(self): |
| 3335 | n = 10 # too small to chunk |
| 3336 | x = set(range(n)) |
| 3337 | for proto in protocols: |
| 3338 | s = self.dumps(x, proto) |
| 3339 | y = self.loads(s) |
| 3340 | self.assert_is_copy(x, y) |
| 3341 | num_additems = count_opcode(pickle.ADDITEMS, s) |
| 3342 | if proto < 4: |
| 3343 | self.assertEqual(num_additems, 0) |
| 3344 | else: |
| 3345 | self.assertEqual(num_additems, 1) |
| 3346 | |
| 3347 | n = 2500 # expect at least two chunks when proto >= 4 |
| 3348 | x = set(range(n)) |
| 3349 | for proto in protocols: |
| 3350 | s = self.dumps(x, proto) |
| 3351 | y = self.loads(s) |
| 3352 | self.assert_is_copy(x, y) |
| 3353 | num_additems = count_opcode(pickle.ADDITEMS, s) |
| 3354 | if proto < 4: |
| 3355 | self.assertEqual(num_additems, 0) |
| 3356 | else: |
| 3357 | self.assertGreaterEqual(num_additems, 2) |
| 3358 | |
| 3359 | def test_simple_newobj(self): |
| 3360 | x = SimpleNewObj.__new__(SimpleNewObj, 0xface) # avoid __init__ |
nothing calls this directly
no test coverage detected