Test remote thread store path boundary
This commit is contained in:
parent
ef4f1e1a52
commit
9c0e24854f
2 changed files with 26 additions and 0 deletions
Binary file not shown.
|
|
@ -115,3 +115,29 @@ fn not_implemented(method: &str) -> ThreadStoreError {
|
|||
message: format!("remote thread store does not implement {method} yet"),
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[tokio::test]
|
||||
async fn rollout_path_read_rejects_remote_store_without_downcast() {
|
||||
let store = RemoteThreadStore::new("http://127.0.0.1:9");
|
||||
|
||||
let error = store
|
||||
.read_thread_by_rollout_path(ReadThreadByRolloutPathParams {
|
||||
rollout_path: "rollout.jsonl".into(),
|
||||
include_archived: true,
|
||||
include_history: false,
|
||||
})
|
||||
.await
|
||||
.expect_err("remote rollout path read should be rejected before network access");
|
||||
|
||||
match error {
|
||||
ThreadStoreError::InvalidRequest { message } => {
|
||||
assert!(message.contains("local thread stores"));
|
||||
}
|
||||
other => panic!("expected invalid request, got {other:?}"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue