agent permissions: drop the test-only direct_get_subject; the failed-creation test names the refusing step
This commit is contained in:
parent
89013b5408
commit
0e7aa74d00
3 changed files with 19 additions and 15 deletions
|
|
@ -4044,7 +4044,7 @@ mod tests {
|
|||
/// Through the real handler: when the inference store fails after the
|
||||
/// permissions are stored, the creation is refused and the permissions go
|
||||
/// back to what they were, the earlier value or no key. The inference
|
||||
/// bucket refuses any value, as above.
|
||||
/// bucket refuses any value, as above, and the refusal is that bucket's.
|
||||
#[tokio::test]
|
||||
async fn a_failed_creation_leaves_no_permissions_behind() {
|
||||
let nats = crate::test_nats::TestNats::start();
|
||||
|
|
@ -4073,9 +4073,20 @@ mod tests {
|
|||
"inference":{{"model":"opus"}}}}"#
|
||||
))
|
||||
.expect("body parses");
|
||||
super::create_agent(axum::extract::State(state.clone()), axum::Json(req))
|
||||
let err = super::create_agent(axum::extract::State(state.clone()), axum::Json(req))
|
||||
.await
|
||||
.expect_err("the inference write must fail");
|
||||
assert_eq!(
|
||||
err.status,
|
||||
Some(axum::http::StatusCode::INTERNAL_SERVER_ERROR),
|
||||
"{agent}: {err:?}"
|
||||
);
|
||||
assert!(
|
||||
err.detail
|
||||
.as_deref()
|
||||
.is_some_and(|d| d.contains("message size exceeds maximum allowed")),
|
||||
"{agent}: refused by the inference bucket, not an earlier check: {err:?}"
|
||||
);
|
||||
}
|
||||
let bucket = swarm_queue_client::agent_permissions::open_or_create(&client)
|
||||
.await
|
||||
|
|
|
|||
Loading…
Reference in a new issue