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

Function test_file_store_overwrite

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

Source from the content-addressed store, hash-verified

382
383#[tokio::test]
384async fn test_file_store_overwrite() {
385 let dir = tempdir().unwrap();
386 let store = FileSessionStore::new(dir.path()).await.unwrap();
387
388 let mut session = create_test_session_data();
389 store.save(&session).await.unwrap();
390
391 // Modify and save again
392 session.messages.push(Message::user("Another message"));
393 session.updated_at = 1700000200;
394 store.save(&session).await.unwrap();
395
396 // Load and verify
397 let loaded = store.load(&session.id).await.unwrap().unwrap();
398 assert_eq!(loaded.messages.len(), 3);
399 assert_eq!(loaded.updated_at, 1700000200);
400}
401
402#[tokio::test]
403async fn test_file_store_path_traversal_prevention() {

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