#[cfg(test)]
mod tests {
use oxi_store::session::{AgentMessage, ContentValue, SessionManager};
use tempfile::TempDir;
#[test]
fn test_create_and_load_session() {
let dir = TempDir::new().unwrap();
let dir_path = dir.path().to_str().unwrap();
let mut manager = SessionManager::create(".", Some(dir_path));
let id = manager.get_session_id();
assert!(!id.is_empty());
let session_file = manager
.get_session_file()
.expect("Session file should be set");
manager.append_message(AgentMessage::User {
content: ContentValue::String("test".to_string()),
});
manager.append_message(AgentMessage::Assistant {
content: vec![],
provider: None,
model_id: None,
usage: None,
stop_reason: None,
});
let path = std::path::Path::new(&session_file);
assert!(path.exists(), "Session file should exist at: {:?}", path);
}
}