Function
assert_success_response
(
res: Result<Response<Incoming>, hyper_util::client::legacy::Error>,
expected_rows: Vec<Vec<String>>,
)
Source from the content-addressed store, hash-verified
| 278 | } |
| 279 | |
| 280 | async fn assert_success_response( |
| 281 | res: Result<Response<Incoming>, hyper_util::client::legacy::Error>, |
| 282 | expected_rows: Vec<Vec<String>>, |
| 283 | ) { |
| 284 | #[derive(Deserialize)] |
| 285 | struct Result { |
| 286 | rows: Vec<Vec<String>>, |
| 287 | } |
| 288 | #[derive(Deserialize)] |
| 289 | struct Response { |
| 290 | results: Vec<Result>, |
| 291 | } |
| 292 | let body = res.unwrap().into_body().collect().await.unwrap().to_bytes(); |
| 293 | let res: Response = serde_json::from_slice(&body).unwrap(); |
| 294 | assert_eq!(res.results[0].rows, expected_rows) |
| 295 | } |
| 296 | |
| 297 | println!("http user={} scheme={}", user_to_auth_as, scheme); |
| 298 | |
Tested by
no test coverage detected