MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_list_chunking

Method test_list_chunking

Lib/test/pickletester.py:3289–3309  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 7

listClass · 0.85
count_opcodeFunction · 0.85
assert_is_copyMethod · 0.80
assertTrueMethod · 0.80
dumpsMethod · 0.45
loadsMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected