This commit is contained in:
Nikolay Kim 2020-04-12 12:49:54 +06:00
parent 26daed37e6
commit 78f14e6d93

View file

@ -118,15 +118,16 @@ async fn test_json() {
assert!(response.status().is_success()); assert!(response.status().is_success());
// same with frozen request // same with frozen request
let request = srv let request = srv.get("/").header("x-test", "111").freeze().unwrap();
.get("/")
.header("x-test", "111")
.freeze().unwrap();
let response = request.send_json(&"TEST".to_string()).await.unwrap(); let response = request.send_json(&"TEST".to_string()).await.unwrap();
assert!(response.status().is_success()); assert!(response.status().is_success());
let response = request.extra_header("x-test2", "112").send_json(&"TEST".to_string()).await.unwrap(); let response = request
.extra_header("x-test2", "112")
.send_json(&"TEST".to_string())
.await
.unwrap();
assert!(response.status().is_success()); assert!(response.status().is_success());
} }
@ -150,7 +151,11 @@ async fn test_form() {
let response = request.send_form(&data).await.unwrap(); let response = request.send_form(&data).await.unwrap();
assert!(response.status().is_success()); assert!(response.status().is_success());
let response = request.extra_header("x-test2", "112").send_form(&data).await.unwrap(); let response = request
.extra_header("x-test2", "112")
.send_form(&data)
.await
.unwrap();
assert!(response.status().is_success()); assert!(response.status().is_success());
} }
@ -806,8 +811,8 @@ async fn client_read_until_eof() {
}); });
// client request // client request
let req = ntex::http::client::Client::default() let req =
.get(format!("http://{}/", addr).as_str()); ntex::http::client::Client::default().get(format!("http://{}/", addr).as_str());
let mut response = req.send().await.unwrap(); let mut response = req.send().await.unwrap();
assert!(response.status().is_success()); assert!(response.status().is_success());