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

Method do_insert_or_update

python/tests/fuzz_test.py:194–207  ·  view source on GitHub ↗

Perform insert or update operation

(self)

Source from the content-addressed store, hash-verified

192 return f"value_{random.randint(1, 1000000)}"
193
194 def do_insert_or_update(self):
195 """Perform insert or update operation"""
196 key = self.random_key(existing_bias=0.3) # Favor new keys for inserts
197 value = self.random_value()
198
199 # Determine operation type before modifying
200 op_type = "update" if key in self.reference else "insert"
201
202 # Apply to both implementations
203 self.btree[key] = value
204 self.reference[key] = value
205
206 self.log_operation(op_type, key, value)
207 return True
208
209 def do_delete(self):
210 """Perform delete operation"""

Callers

nothing calls this directly

Calls 3

random_keyMethod · 0.95
random_valueMethod · 0.95
log_operationMethod · 0.95

Tested by

no test coverage detected