fix: employee ID pagination, add async tests

- next_employee_id now paginates through all identities (was limited to 200)
- Add #[tokio::test] tests: ensure_tunnel noop, BaoClient connection error,
  check_update_background returns quickly when forge URL empty
This commit is contained in:
2026-03-20 13:37:25 +00:00
parent 019c73e300
commit dff4588e52
4 changed files with 78 additions and 22 deletions

View File

@@ -483,4 +483,16 @@ mod tests {
let client = BaoClient::new("http://localhost:8200");
assert!(client.token.is_none());
}
#[tokio::test]
async fn test_seal_status_error_on_nonexistent_server() {
// Connecting to a port where nothing is listening should produce an
// error (connection refused), not a panic or hang.
let client = BaoClient::new("http://127.0.0.1:19999");
let result = client.seal_status().await;
assert!(
result.is_err(),
"seal_status should return an error when the server is unreachable"
);
}
}