ffs still works on my machine
cargo devel CI / cargo CI (push) Failing after 2m23s
Details
cargo devel CI / cargo CI (push) Failing after 2m23s
Details
This commit is contained in:
parent
e3c0bde063
commit
d1ea0b61e4
|
@ -101,6 +101,7 @@ mod test {
|
||||||
|
|
||||||
use std::convert::From;
|
use std::convert::From;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
use hyper::body::Bytes;
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_register_and_get() {
|
async fn test_register_and_get() {
|
||||||
|
@ -115,7 +116,7 @@ mod test {
|
||||||
.into_response();
|
.into_response();
|
||||||
|
|
||||||
assert_eq!(response.status(), StatusCode::OK);
|
assert_eq!(response.status(), StatusCode::OK);
|
||||||
let body_raw: Bytes = hyper::body::to_bytes(response.into_body()).await.unwrap();
|
let body_raw = hyper::body::to_bytes(response.into_body()).await.unwrap();
|
||||||
let body_json: serde_json::Value = serde_json::from_slice(&body_raw).unwrap();
|
let body_json: serde_json::Value = serde_json::from_slice(&body_raw).unwrap();
|
||||||
|
|
||||||
assert!(body_json.is_object());
|
assert!(body_json.is_object());
|
||||||
|
@ -148,14 +149,13 @@ mod test {
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.into_response();
|
.into_response();
|
||||||
assert_eq!(response.status(), StatusCode::OK);
|
assert_eq!(response.status(), StatusCode::OK);
|
||||||
let body_raw: Bytes = hyper::body::to_bytes(response.into_body()).await.unwrap();
|
let body_raw = hyper::body::to_bytes(response.into_body()).await.unwrap();
|
||||||
let body_json: serde_json::Value = serde_json::from_slice(&body_raw).unwrap();
|
let body_json: serde_json::Value = serde_json::from_slice(&body_raw).unwrap();
|
||||||
assert!(body_json.is_array());
|
assert!(body_json.is_array());
|
||||||
|
|
||||||
for i in 0..2 {
|
for i in 0..2 {
|
||||||
assert!(body_json[i].is_object());
|
assert!(body_json[i].is_object());
|
||||||
let item: crate::Item =
|
let item: crate::Item = serde_json::from_value(body_json[i].clone().take()).unwrap();
|
||||||
serde_json::from_value(body_json[i].clone().take()).unwrap();
|
|
||||||
assert_eq!(item.seq, i);
|
assert_eq!(item.seq, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue