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

Method _test_recursive_dict

Lib/test/pickletester.py:2571–2581  ·  view source on GitHub ↗
(self, cls, asdict=identity, minprotocol=0)

Source from the content-addressed store, hash-verified

2569 self._test_recursive_tuple_and_list(REX_six, aslist=lambda x: x.items)
2570
2571 def _test_recursive_dict(self, cls, asdict=identity, minprotocol=0):
2572 # Dict containing itself.
2573 d = cls()
2574 d[1] = d
2575 for proto in range(minprotocol, pickle.HIGHEST_PROTOCOL + 1):
2576 s = self.dumps(d, proto)
2577 x = self.loads(s)
2578 self.assertIsInstance(x, cls)
2579 y = asdict(x)
2580 self.assertEqual(list(y.keys()), [1])
2581 self.assertIs(y[1], x)
2582
2583 def test_recursive_dict(self):
2584 self._test_recursive_dict(dict)

Callers 3

test_recursive_dictMethod · 0.95

Calls 9

asdictFunction · 0.85
listClass · 0.85
assertIsInstanceMethod · 0.80
clsClass · 0.50
dumpsMethod · 0.45
loadsMethod · 0.45
assertEqualMethod · 0.45
keysMethod · 0.45
assertIsMethod · 0.45

Tested by

no test coverage detected