MCPcopy Create free account
hub / github.com/KentBeck/BPlusTree3 / test_overflow

Method test_overflow

python/tests/test_bplus_tree.py:95–112  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

93 """Test B+ tree operations when splitting nodes"""
94
95 def test_overflow(self):
96 tree = BPlusTreeMap(capacity=4)
97 # With capacity=4, need 5 items to force a split
98 tree[1] = "one"
99 tree[2] = "two"
100 tree[3] = "three"
101 tree[4] = "four"
102 tree[5] = "five"
103
104 assert check_invariants(tree)
105 assert len(tree) == 5
106 assert tree[1] == "one"
107 assert tree[2] == "two"
108 assert tree[3] == "three"
109 assert tree[4] == "four"
110 assert tree[5] == "five"
111
112 assert not tree.root.is_leaf()
113
114 def test_split_then_add(self):
115 tree = BPlusTreeMap(capacity=4)

Callers

nothing calls this directly

Calls 3

BPlusTreeMapClass · 0.90
check_invariantsFunction · 0.70
is_leafMethod · 0.45

Tested by

no test coverage detected