MCPcopy Index your code
hub / github.com/python/cpython / test_deep_nesting

Method test_deep_nesting

Lib/test/test_plistlib.py:1056–1068  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1054 self.assertIs(b['x'], b)
1055
1056 def test_deep_nesting(self):
1057 for N in [50, 300, 100_000]:
1058 chunks = [b'\xa1' + (i + 1).to_bytes(4, 'big') for i in range(N)]
1059 try:
1060 result = self.decode(*chunks, b'\x54seed', offset_size=4, ref_size=4)
1061 except RecursionError:
1062 self.assertGreater(N, sys.getrecursionlimit())
1063 else:
1064 for i in range(N):
1065 self.assertIsInstance(result, list)
1066 self.assertEqual(len(result), 1)
1067 result = result[0]
1068 self.assertEqual(result, 'seed')
1069
1070 def test_large_timestamp(self):
1071 # Issue #26709: 32-bit timestamp out of range

Callers

nothing calls this directly

Calls 4

decodeMethod · 0.95
assertGreaterMethod · 0.80
assertIsInstanceMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected