MCPcopy Create free account
hub / github.com/rthalley/dnspython / test_random_trees

Function test_random_trees

tests/test_btree.py:286–303  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

284
285
286def test_random_trees():
287 N = len(random_keys_1)
288 b = BTreeDict()
289 add_keys(b, random_keys_1)
290 expected = list(range(N))
291 assert list(b.keys()) == expected
292
293 for key in random_keys_1:
294 assert b[key]
295
296 keys = random_keys_2
297 expected_len = N
298 for key in keys:
299 l = len(b)
300 assert l == expected_len
301 expected_len -= 1
302 del b[key]
303 assert len(b) == 0
304
305
306def test_random_trees_no_in_order_optimization():

Callers

nothing calls this directly

Calls 3

add_keysFunction · 0.85
BTreeDictClass · 0.70
keysMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…