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

Method test_unpickler_super

Lib/test/test_pickle.py:325–337  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

323 self.assertEqual(self.loads(f.getvalue()), 'abc')
324
325 def test_unpickler_super(self):
326 class PersUnpickler(self.unpickler):
327 def persistent_load(subself, pid):
328 called.append(pid)
329 with self.assertRaises(self.persistent_load_error):
330 super().persistent_load(pid)
331 return pid
332
333 for proto in range(pickle.HIGHEST_PROTOCOL + 1):
334 unpickler = PersUnpickler(io.BytesIO(self.dumps('abc', proto)))
335 called = []
336 self.assertEqual(unpickler.load(), 'abc')
337 self.assertEqual(called, ['abc'])
338
339 def test_pickler_instance_attribute(self):
340 def persistent_id(obj):

Callers

nothing calls this directly

Calls 4

PersUnpicklerClass · 0.70
dumpsMethod · 0.45
assertEqualMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected