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

Function test_file_store_list

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

Source from the content-addressed store, hash-verified

358
359#[tokio::test]
360async fn test_file_store_list() {
361 let dir = tempdir().unwrap();
362 let store = FileSessionStore::new(dir.path()).await.unwrap();
363
364 // Initially empty
365 let list = store.list().await.unwrap();
366 assert!(list.is_empty());
367
368 // Add sessions
369 for i in 1..=3 {
370 let mut session = create_test_session_data();
371 session.id = format!("session-{}", i);
372 store.save(&session).await.unwrap();
373 }
374
375 // List should have 3 sessions
376 let list = store.list().await.unwrap();
377 assert_eq!(list.len(), 3);
378 assert!(list.contains(&"session-1".to_string()));
379 assert!(list.contains(&"session-2".to_string()));
380 assert!(list.contains(&"session-3".to_string()));
381}
382
383#[tokio::test]
384async fn test_file_store_overwrite() {

Callers

nothing calls this directly

Calls 4

create_test_session_dataFunction · 0.85
pathMethod · 0.80
listMethod · 0.45
saveMethod · 0.45

Tested by

no test coverage detected