MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / assert_success_response

Function assert_success_response

src/environmentd/tests/auth.rs:280–295  ·  view source on GitHub ↗
(
                    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

Callers 1

run_testsFunction · 0.85

Calls 7

unwrapMethod · 0.80
is_someMethod · 0.80
to_bytesMethod · 0.45
collectMethod · 0.45
readMethod · 0.45
into_iterMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected