Watch
0
0
Fork
You've already forked hyperhive
0

swarm-controller: check the reserved matrix account is not deleted

`the_agents_own_matrix_account_cannot_be_deleted` checked only the 400.
It now runs against a store that holds `main` and asserts nothing was
deleted. `revoke` is off so that, if the reserved check ever stopped
refusing, the handler would delete the stored account and fail the test
rather than call a homeserver.
This commit is contained in:
atlas 2026-10-04 08:26:54 +02:00
commit 35f509d717

View file

@ -984,10 +984,11 @@ pub(crate) mod tests {
.await
}
/// Refused before the store, and before any revoke.
/// Refused before the store: `main` is stored, and stays.
#[tokio::test]
async fn the_agents_own_matrix_account_cannot_be_deleted() {
let problem = delete_matrix(&Arc::default(), "main", true)
let store = Arc::new(every_kind());
let problem = delete_matrix(&store, "main", false)
.await
.expect_err("'main' is reserved");
assert_eq!(
@ -995,6 +996,7 @@ pub(crate) mod tests {
Some(axum::http::StatusCode::BAD_REQUEST),
"{problem:?}"
);
assert!(deleted(&store).is_empty());
}
/// The control: any other account name is deleted.