MCPcopy Create free account
hub / github.com/AI45Lab/Code / test_file_store_save_and_load

Function test_file_store_save_and_load

core/src/store/tests.rs:106–124  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

104
105#[tokio::test]
106async fn test_file_store_save_and_load() {
107 let dir = tempdir().unwrap();
108 let store = FileSessionStore::new(dir.path()).await.unwrap();
109
110 let session = create_test_session_data();
111
112 // Save
113 store.save(&session).await.unwrap();
114
115 // Load
116 let loaded = store.load(&session.id).await.unwrap();
117 assert!(loaded.is_some());
118
119 let loaded = loaded.unwrap();
120 assert_eq!(loaded.id, session.id);
121 assert_eq!(loaded.config.name, session.config.name);
122 assert_eq!(loaded.messages.len(), 2);
123 assert_eq!(loaded.state, SessionState::Active);
124}
125
126#[tokio::test]
127async fn test_file_store_load_nonexistent() {

Callers

nothing calls this directly

Calls 4

create_test_session_dataFunction · 0.85
pathMethod · 0.80
saveMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected