()
| 2039 | |
| 2040 | #[tokio::test(flavor = "multi_thread")] |
| 2041 | async fn test_session_save_and_load() { |
| 2042 | let store = Arc::new(crate::store::MemorySessionStore::new()); |
| 2043 | let agent = Agent::from_config(test_config()).await.unwrap(); |
| 2044 | |
| 2045 | let opts = SessionOptions::new() |
| 2046 | .with_session_store(store.clone()) |
| 2047 | .with_session_id("persist-test"); |
| 2048 | let session = agent.session("/tmp/test-ws-persist", Some(opts)).unwrap(); |
| 2049 | |
| 2050 | // Save empty session |
| 2051 | session.save().await.unwrap(); |
| 2052 | |
| 2053 | // Verify it was stored |
| 2054 | assert!(store.exists("persist-test").await.unwrap()); |
| 2055 | |
| 2056 | let data = store.load("persist-test").await.unwrap().unwrap(); |
| 2057 | assert_eq!(data.id, "persist-test"); |
| 2058 | assert!(data.messages.is_empty()); |
| 2059 | } |
| 2060 | |
| 2061 | #[tokio::test(flavor = "multi_thread")] |
| 2062 | async fn test_session_save_persists_runtime_config() { |
nothing calls this directly
no test coverage detected