use super::*;
use serde_json::Value;
impl Recorder {
pub(crate) fn test(state: &Path, id: &str) -> Self {
let id: crate::types::SessionId = id.parse().unwrap();
Self {
state: Recording::Pending(Box::new(Pending {
path: path(state, &id),
reference: SessionRef {
producer: "tester@host".parse().unwrap(),
state: "state".parse().unwrap(),
run_id: "run".parse().unwrap(),
request_id: "request".parse().unwrap(),
session_id: id.clone(),
},
eval_id: None,
target: None,
})),
..Self::off(&id)
}
}
}
impl Conversation {
pub(crate) fn wire_events(&self) -> Vec<Value> {
self.original
.iter()
.map(|event| serde_json::from_str(event.get()).unwrap())
.collect()
}
}