MCPcopy Create free account
hub / github.com/ExtendDB/extenddb / put_to_replace_existing_item

Function put_to_replace_existing_item

tests/rust/src/put_item.rs:365–389  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

363
364#[tokio::test]
365async fn put_to_replace_existing_item() {
366 let c = client();
367 let t = tables().await;
368 let item = create_item(&t.simple_key_string);
369 c.put_item()
370 .table_name(&t.simple_key_string)
371 .set_item(Some(item.clone()))
372 .send()
373 .await
374 .unwrap();
375
376 let mut new_item = get_key(&t.simple_key_string, &item);
377 new_item.insert("str".into(), s("replaced"));
378 new_item.insert("num".into(), n(99));
379 new_item.insert("extraAttr".into(), s("extra"));
380 c.put_item()
381 .table_name(&t.simple_key_string)
382 .set_item(Some(new_item.clone()))
383 .send()
384 .await
385 .unwrap();
386
387 let retrieved = check_item(c, &t.simple_key_string, &new_item).await;
388 assert!(!retrieved.contains_key("oldAttr"));
389}
390
391#[tokio::test]
392async fn put_item_with_expected_wrong_value() {

Callers

nothing calls this directly

Calls 11

clientFunction · 0.85
tablesFunction · 0.85
create_itemFunction · 0.85
get_keyFunction · 0.85
sFunction · 0.85
nFunction · 0.85
check_itemFunction · 0.85
table_nameMethod · 0.80
put_itemMethod · 0.80
insertMethod · 0.80
cloneMethod · 0.45

Tested by

no test coverage detected