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

Function test_store_list

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

Source from the content-addressed store, hash-verified

958
959 #[test]
960 fn test_store_list() {
961 let (_temp, store) = create_test_store();
962
963 let alice = Identity::generate("alice");
964 let bob = Identity::generate("bob");
965
966 store.save(&alice).unwrap();
967 store.save(&bob).unwrap();
968
969 let identities = store.list().unwrap();
970 assert_eq!(identities.len(), 2);
971
972 let names: Vec<_> = identities.iter().map(|i| i.name.as_str()).collect();
973 assert!(names.contains(&"alice"));
974 assert!(names.contains(&"bob"));
975 }
976
977 #[test]
978 fn test_store_list_filtered() {

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected