fix remaining client tests

This commit is contained in:
Rob Ede 2021-01-17 04:27:53 +00:00
parent bcdc1e3cba
commit 3c01874dd7
No known key found for this signature in database
GPG Key ID: C2A3B36E841A91E6
1 changed files with 5 additions and 11 deletions

View File

@ -570,10 +570,7 @@ async fn test_client_deflate_encoding() {
}))
});
let req = srv
.post("/")
.insert_header(header::ContentEncoding::Deflate)
.send_body(STR);
let req = srv.post("/").send_body(STR);
let mut res = req.await.unwrap();
assert_eq!(res.status(), StatusCode::OK);
@ -598,16 +595,13 @@ async fn test_client_deflate_encoding_large_random() {
}))
});
let req = srv
.post("/")
.insert_header(header::ContentEncoding::Deflate)
.send_body(data.clone());
let req = srv.post("/").send_body(data.clone());
let mut res = req.await.unwrap();
assert_eq!(res.status(), StatusCode::OK);
let bytes = res.body().await.unwrap();
assert_eq!(bytes, Bytes::from(data));
assert_eq!(res.status(), StatusCode::BAD_REQUEST);
assert_eq!(bytes, Bytes::from_static(b"corrupt deflate stream"));
}
#[actix_rt::test]