mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-31 00:00:10 +02:00
Update to hyper 1.0-rc.3 and http-body-util 0.1.0-rc.2
This commit is contained in:
@@ -9,5 +9,6 @@ axum = { path = "../../axum" }
|
||||
tokio = { version = "1.0", features = ["full"] }
|
||||
|
||||
[dev-dependencies]
|
||||
http-body-util = "0.1.0-rc.2"
|
||||
hyper = { version = "1.0.0-rc.3", features = ["full"] }
|
||||
tower = { version = "0.4", features = ["util"] }
|
||||
|
||||
@@ -44,6 +44,7 @@ mod tests {
|
||||
use super::*;
|
||||
use axum::body::Body;
|
||||
use axum::http::{Request, StatusCode};
|
||||
use http_body_util::BodyExt;
|
||||
use tower::ServiceExt;
|
||||
|
||||
#[tokio::test]
|
||||
@@ -58,7 +59,7 @@ mod tests {
|
||||
assert_eq!(response.status(), StatusCode::OK);
|
||||
assert_eq!(response.headers()["x-some-header"], "header from GET");
|
||||
|
||||
let body = hyper::body::to_bytes(response.into_body()).await.unwrap();
|
||||
let body = response.collect().await.unwrap().to_bytes();
|
||||
assert_eq!(&body[..], b"body from GET");
|
||||
}
|
||||
|
||||
@@ -74,7 +75,7 @@ mod tests {
|
||||
assert_eq!(response.status(), StatusCode::OK);
|
||||
assert_eq!(response.headers()["x-some-header"], "header from HEAD");
|
||||
|
||||
let body = hyper::body::to_bytes(response.into_body()).await.unwrap();
|
||||
let body = response.collect().await.unwrap().to_bytes();
|
||||
assert!(body.is_empty());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user