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

Method test_pickle

Lib/test/test_collections.py:568–577  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

566 self.assertEqual(b._fields, tuple(names))
567
568 def test_pickle(self):
569 p = TestNT(x=10, y=20, z=30)
570 for module in (pickle,):
571 loads = getattr(module, 'loads')
572 dumps = getattr(module, 'dumps')
573 for protocol in range(-1, module.HIGHEST_PROTOCOL + 1):
574 q = loads(dumps(p, protocol))
575 self.assertEqual(p, q)
576 self.assertEqual(p._fields, q._fields)
577 self.assertNotIn(b'OrderedDict', dumps(p, protocol))
578
579 def test_copy(self):
580 p = TestNT(x=10, y=20, z=30)

Callers

nothing calls this directly

Calls 5

getattrFunction · 0.85
assertNotInMethod · 0.80
loadsFunction · 0.50
dumpsFunction · 0.50
assertEqualMethod · 0.45

Tested by

no test coverage detected