MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_store_list

Function test_store_list

atomic-identity/src/store.rs:1047–1062  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1045
1046 #[test]
1047 fn test_store_list() {
1048 let (_temp, store) = create_test_store();
1049
1050 let alice = Identity::generate("alice");
1051 let bob = Identity::generate("bob");
1052
1053 store.save(&alice).unwrap();
1054 store.save(&bob).unwrap();
1055
1056 let identities = store.list().unwrap();
1057 assert_eq!(identities.len(), 2);
1058
1059 let names: Vec<_> = identities.iter().map(|i| i.name.as_str()).collect();
1060 assert!(names.contains(&"alice"));
1061 assert!(names.contains(&"bob"));
1062 }
1063
1064 #[test]
1065 fn test_store_list_filtered() {

Callers

nothing calls this directly

Calls 7

create_test_storeFunction · 0.70
unwrapMethod · 0.45
saveMethod · 0.45
listMethod · 0.45
collectMethod · 0.45
iterMethod · 0.45
as_strMethod · 0.45

Tested by

no test coverage detected