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

Function test_key_not_found

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

Test lookup of non-existent key

(name)

Source from the content-addressed store, hash-verified

271 results.ok("bulk upsert (100 items, sampled)")
272
273def test_key_not_found(name):
274 """Test lookup of non-existent key"""
275 print("\n[Test: Key Not Found]")
276
277 try:
278 lookup(name, "nonexistent_key_xyz_123")
279 results.fail("nonexistent key", "exception", "no exception")
280 except Exception as e:
281 if "not found" in str(e).lower() or "404" in str(e) or "Failed" in str(e):
282 results.ok("nonexistent key raises exception")
283 else:
284 results.ok(f"nonexistent key raises exception: {e}")
285
286def test_transaction_abort(name):
287 """Test that aborted transactions don't persist"""

Callers 1

mainFunction · 0.85

Calls 3

failMethod · 0.80
okMethod · 0.80
lookupFunction · 0.70

Tested by

no test coverage detected