mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-23 23:51:06 +01:00
update tests
This commit is contained in:
parent
86405cfe7a
commit
1f9467e880
@ -50,7 +50,7 @@ fn test_start() {
|
||||
|
||||
let mut connector = test::run_on(|| {
|
||||
Ok::<_, ()>(
|
||||
client::Connector::default()
|
||||
client::Connector::new()
|
||||
.timeout(Duration::from_millis(100))
|
||||
.service(),
|
||||
)
|
||||
|
@ -69,7 +69,7 @@ fn test_body_gzip() {
|
||||
assert!(response.status().is_success());
|
||||
|
||||
// read response
|
||||
let bytes = srv.execute(response.body()).unwrap();
|
||||
let bytes = srv.block_on(response.body()).unwrap();
|
||||
|
||||
// decode
|
||||
let mut e = GzDecoder::new(&bytes[..]);
|
||||
@ -100,7 +100,7 @@ fn test_body_gzip_large() {
|
||||
assert!(response.status().is_success());
|
||||
|
||||
// read response
|
||||
let bytes = srv.execute(response.body()).unwrap();
|
||||
let bytes = srv.block_on(response.body()).unwrap();
|
||||
|
||||
// decode
|
||||
let mut e = GzDecoder::new(&bytes[..]);
|
||||
@ -134,7 +134,7 @@ fn test_body_gzip_large_random() {
|
||||
assert!(response.status().is_success());
|
||||
|
||||
// read response
|
||||
let bytes = srv.execute(response.body()).unwrap();
|
||||
let bytes = srv.block_on(response.body()).unwrap();
|
||||
|
||||
// decode
|
||||
let mut e = GzDecoder::new(&bytes[..]);
|
||||
@ -167,7 +167,7 @@ fn test_body_chunked_implicit() {
|
||||
);
|
||||
|
||||
// read response
|
||||
let bytes = srv.execute(response.body()).unwrap();
|
||||
let bytes = srv.block_on(response.body()).unwrap();
|
||||
|
||||
// decode
|
||||
let mut e = GzDecoder::new(&bytes[..]);
|
||||
@ -195,7 +195,7 @@ fn test_body_br_streaming() {
|
||||
assert!(response.status().is_success());
|
||||
|
||||
// read response
|
||||
let bytes = srv.execute(response.body()).unwrap();
|
||||
let bytes = srv.block_on(response.body()).unwrap();
|
||||
|
||||
// decode br
|
||||
let mut e = BrotliDecoder::new(Vec::with_capacity(2048));
|
||||
@ -222,7 +222,7 @@ fn test_head_binary() {
|
||||
}
|
||||
|
||||
// read response
|
||||
let bytes = srv.execute(response.body()).unwrap();
|
||||
let bytes = srv.block_on(response.body()).unwrap();
|
||||
assert!(bytes.is_empty());
|
||||
}
|
||||
|
||||
@ -245,7 +245,7 @@ fn test_no_chunking() {
|
||||
assert!(!response.headers().contains_key(TRANSFER_ENCODING));
|
||||
|
||||
// read response
|
||||
let bytes = srv.execute(response.body()).unwrap();
|
||||
let bytes = srv.block_on(response.body()).unwrap();
|
||||
assert_eq!(bytes, Bytes::from_static(STR.as_ref()));
|
||||
}
|
||||
|
||||
@ -267,7 +267,7 @@ fn test_body_deflate() {
|
||||
assert!(response.status().is_success());
|
||||
|
||||
// read response
|
||||
let bytes = srv.execute(response.body()).unwrap();
|
||||
let bytes = srv.block_on(response.body()).unwrap();
|
||||
|
||||
// decode deflate
|
||||
let mut e = ZlibDecoder::new(Vec::new());
|
||||
@ -294,7 +294,7 @@ fn test_body_brotli() {
|
||||
assert!(response.status().is_success());
|
||||
|
||||
// read response
|
||||
let bytes = srv.execute(response.body()).unwrap();
|
||||
let bytes = srv.block_on(response.body()).unwrap();
|
||||
|
||||
// decode brotli
|
||||
let mut e = BrotliDecoder::new(Vec::with_capacity(2048));
|
||||
@ -327,11 +327,11 @@ fn test_body_brotli() {
|
||||
// .header(http::header::CONTENT_ENCODING, "gzip")
|
||||
// .body(enc.clone())
|
||||
// .unwrap();
|
||||
// let response = srv.execute(request.send()).unwrap();
|
||||
// let response = srv.block_on(request.send()).unwrap();
|
||||
// assert!(response.status().is_success());
|
||||
|
||||
// // read response
|
||||
// let bytes = srv.execute(response.body()).unwrap();
|
||||
// let bytes = srv.block_on(response.body()).unwrap();
|
||||
// assert_eq!(bytes, Bytes::from_static(STR.as_ref()));
|
||||
// }
|
||||
|
||||
@ -360,11 +360,11 @@ fn test_body_brotli() {
|
||||
// .header(http::header::CONTENT_ENCODING, "gzip")
|
||||
// .body(enc.clone())
|
||||
// .unwrap();
|
||||
// let response = srv.execute(request.send()).unwrap();
|
||||
// let response = srv.block_on(request.send()).unwrap();
|
||||
// assert!(response.status().is_success());
|
||||
|
||||
// // read response
|
||||
// let bytes = srv.execute(response.body()).unwrap();
|
||||
// let bytes = srv.block_on(response.body()).unwrap();
|
||||
// assert_eq!(bytes, Bytes::from(data));
|
||||
// }
|
||||
|
||||
@ -397,11 +397,11 @@ fn test_body_brotli() {
|
||||
// .header(http::header::CONTENT_ENCODING, "gzip")
|
||||
// .body(enc.clone())
|
||||
// .unwrap();
|
||||
// let response = srv.execute(request.send()).unwrap();
|
||||
// let response = srv.block_on(request.send()).unwrap();
|
||||
// assert!(response.status().is_success());
|
||||
|
||||
// // read response
|
||||
// let bytes = srv.execute(response.body()).unwrap();
|
||||
// let bytes = srv.block_on(response.body()).unwrap();
|
||||
// assert_eq!(bytes.len(), data.len());
|
||||
// assert_eq!(bytes, Bytes::from(data));
|
||||
// }
|
||||
@ -430,11 +430,11 @@ fn test_body_brotli() {
|
||||
// .header(http::header::CONTENT_ENCODING, "deflate")
|
||||
// .body(enc)
|
||||
// .unwrap();
|
||||
// let response = srv.execute(request.send()).unwrap();
|
||||
// let response = srv.block_on(request.send()).unwrap();
|
||||
// assert!(response.status().is_success());
|
||||
|
||||
// // read response
|
||||
// let bytes = srv.execute(response.body()).unwrap();
|
||||
// let bytes = srv.block_on(response.body()).unwrap();
|
||||
// assert_eq!(bytes, Bytes::from_static(STR.as_ref()));
|
||||
// }
|
||||
|
||||
@ -463,11 +463,11 @@ fn test_body_brotli() {
|
||||
// .header(http::header::CONTENT_ENCODING, "deflate")
|
||||
// .body(enc)
|
||||
// .unwrap();
|
||||
// let response = srv.execute(request.send()).unwrap();
|
||||
// let response = srv.block_on(request.send()).unwrap();
|
||||
// assert!(response.status().is_success());
|
||||
|
||||
// // read response
|
||||
// let bytes = srv.execute(response.body()).unwrap();
|
||||
// let bytes = srv.block_on(response.body()).unwrap();
|
||||
// assert_eq!(bytes, Bytes::from(data));
|
||||
// }
|
||||
|
||||
@ -500,7 +500,7 @@ fn test_body_brotli() {
|
||||
// .header(http::header::CONTENT_ENCODING, "deflate")
|
||||
// .body(enc)
|
||||
// .unwrap();
|
||||
// let response = srv.execute(request.send()).unwrap();
|
||||
// let response = srv.block_on(request.send()).unwrap();
|
||||
// assert!(response.status().is_success());
|
||||
|
||||
// // read response
|
||||
|
Loading…
Reference in New Issue
Block a user