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

Method test_keys_iterator

python/tests/test_iterator.py:61–68  ·  view source on GitHub ↗

Test iterating over just keys

(self)

Source from the content-addressed store, hash-verified

59 assert items[i][0] > items[i - 1][0]
60
61 def test_keys_iterator(self):
62 """Test iterating over just keys"""
63 tree = BPlusTreeMap(capacity=4)
64 for i in [5, 2, 8, 1, 9, 3]:
65 tree[i] = f"value{i}"
66
67 keys = list(tree.keys())
68 assert keys == [1, 2, 3, 5, 8, 9]
69
70 def test_values_iterator(self):
71 """Test iterating over just values"""

Callers

nothing calls this directly

Calls 2

keysMethod · 0.95
BPlusTreeMapClass · 0.90

Tested by

no test coverage detected