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

Function test_store_default_identity

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

Source from the content-addressed store, hash-verified

1012
1013 #[test]
1014 fn test_store_default_identity() {
1015 let (_temp, mut store) = create_test_store();
1016
1017 let identity = Identity::generate("default-user");
1018 store.save(&identity).unwrap();
1019
1020 assert!(store.get_default().unwrap().is_none());
1021
1022 store.set_default(&identity.id).unwrap();
1023
1024 let default = store.get_default().unwrap().unwrap();
1025 assert_eq!(default.id, identity.id);
1026 }
1027
1028 #[test]
1029 fn test_store_default_by_usage() {

Callers

nothing calls this directly

Calls 5

create_test_storeFunction · 0.70
unwrapMethod · 0.45
saveMethod · 0.45
set_defaultMethod · 0.45
get_defaultMethod · 0.45

Tested by

no test coverage detected