MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / assert_doc_absent

Function assert_doc_absent

nodedb-test-support/src/tx_batch_helpers.rs:314–329  ·  view source on GitHub ↗

Assert that a document is absent (NotFound or empty payload).

(
    core: &mut CoreLoop,
    tx: &mut Producer<BridgeRequest>,
    rx: &mut Consumer<BridgeResponse>,
    collection: &str,
    doc_id: &str,
)

Source from the content-addressed store, hash-verified

312
313/// Assert that a document is absent (NotFound or empty payload).
314pub fn assert_doc_absent(
315 core: &mut CoreLoop,
316 tx: &mut Producer<BridgeRequest>,
317 rx: &mut Consumer<BridgeResponse>,
318 collection: &str,
319 doc_id: &str,
320) {
321 let r = send_raw(core, tx, rx, doc_get(collection, doc_id));
322 let is_absent = r.status == Status::Error || r.payload.is_empty() || r.payload.len() <= 3;
323 assert!(
324 is_absent,
325 "doc {collection}/{doc_id} must be absent after rollback; status={:?} payload_len={}",
326 r.status,
327 r.payload.len()
328 );
329}
330
331/// Assert that graph node `src` has no REL neighbors.
332pub fn assert_edge_absent(

Calls 4

send_rawFunction · 0.70
doc_getFunction · 0.70
is_emptyMethod · 0.45
lenMethod · 0.45