fix h2 service error tests

This commit is contained in:
Ronald Chan 2019-09-09 16:39:33 +08:00
parent beb04b5982
commit 1c86911e66
2 changed files with 4 additions and 4 deletions

View File

@ -454,9 +454,9 @@ fn test_h2_service_error() {
}); });
let response = srv.block_on(srv.sget("/").send()).unwrap(); let response = srv.block_on(srv.sget("/").send()).unwrap();
assert_eq!(response.status(), http::StatusCode::INTERNAL_SERVER_ERROR); assert_eq!(response.status(), http::StatusCode::BAD_REQUEST);
// read response // read response
let bytes = srv.load_body(response).unwrap(); let bytes = srv.load_body(response).unwrap();
assert!(bytes.is_empty()); assert_eq!(bytes, Bytes::from_static(b"error"));
} }

View File

@ -449,11 +449,11 @@ fn test_h2_service_error() {
}); });
let response = srv.block_on(srv.sget("/").send()).unwrap(); let response = srv.block_on(srv.sget("/").send()).unwrap();
assert_eq!(response.status(), StatusCode::INTERNAL_SERVER_ERROR); assert_eq!(response.status(), StatusCode::BAD_REQUEST);
// read response // read response
let bytes = srv.load_body(response).unwrap(); let bytes = srv.load_body(response).unwrap();
assert!(bytes.is_empty()); assert_eq!(bytes, Bytes::from_static(b"error"));
} }
#[test] #[test]