MCPcopy Create free account
hub / github.com/cosdata/cosdata / test_transaction_abort

Function test_transaction_abort

tests/test-key-value-store.py:286–298  ·  view source on GitHub ↗

Test that aborted transactions don't persist

(name)

Source from the content-addressed store, hash-verified

284 results.ok(f"nonexistent key raises exception: {e}")
285
286def test_transaction_abort(name):
287 """Test that aborted transactions don't persist"""
288 print("\n[Test: Transaction Abort]")
289
290 txn_id = create_transaction(name)
291 upsert(name, txn_id, "abort_test_key", "should_not_exist")
292 abort_transaction(name, txn_id)
293
294 try:
295 lookup(name, "abort_test_key")
296 results.fail("aborted key", "not found", "found")
297 except Exception:
298 results.ok("aborted transaction not persisted")
299
300def test_multiple_transactions(name):
301 """Test multiple sequential transactions"""

Callers 1

mainFunction · 0.85

Calls 6

failMethod · 0.80
okMethod · 0.80
create_transactionFunction · 0.70
upsertFunction · 0.70
abort_transactionFunction · 0.70
lookupFunction · 0.70

Tested by

no test coverage detected