Skip to content
Snippets Groups Projects
Commit 5569d385 authored by Éloïs's avatar Éloïs
Browse files

[tests] gva: replace pretty_assertions by assert_json_diff

parent 1b56d412
No related branches found
No related tags found
No related merge requests found
......@@ -287,6 +287,15 @@ name = "ascii"
version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "assert-json-diff"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "atty"
version = "0.2.13"
......@@ -1040,6 +1049,7 @@ name = "durs-gva"
version = "0.1.0"
dependencies = [
"actix-web 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
"assert-json-diff 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
"dubp-block-doc 0.1.0",
......@@ -1061,7 +1071,6 @@ dependencies = [
"juniper-from-schema 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"mockall 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
"pretty_assertions 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)",
......@@ -3360,6 +3369,7 @@ dependencies = [
"checksum arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0d382e583f07208808f6b1249e60848879ba3543f57c32277bf52d69c2f0f0ee"
"checksum arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8"
"checksum ascii 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e"
"checksum assert-json-diff 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9881d306dee755eccf052d652b774a6b2861e86b4772f555262130e58e4f81d2"
"checksum atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90"
"checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2"
"checksum awc 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "5e995283278dd3bf0449e7534e77184adb1570c0de8b6a50bf7c9d01ad8db8c4"
......
......@@ -35,10 +35,10 @@ serde_json = "1.0.41"
structopt= "0.3.4"
[dev-dependencies]
assert-json-diff = "1.0.1"
durs-bc-db-reader = { path = "../../modules-lib/bc-db-reader", features = ["client-indexer", "mock"] }
dubp-blocks-tests-tools = { path = "../../tests-tools/blocks-tests-tools" }
dup-crypto-tests-tools = { path = "../../tests-tools/crypto-tests-tools" }
mockall = "0.5.2"
pretty_assertions = "0.5.1"
[features]
......@@ -32,8 +32,8 @@ mod tests {
use actix_web::http;
use actix_web::test;
use actix_web::web;
use assert_json_diff::assert_json_eq;
use juniper::http::GraphQLRequest;
use pretty_assertions::assert_eq;
use std::str::FromStr;
use std::sync::Arc;
......@@ -65,7 +65,7 @@ mod tests {
.unwrap();
assert_eq!(resp.status(), http::StatusCode::OK);
if let Some(Body::Bytes(ref body_bytes)) = resp.body().as_ref() {
assert_eq!(
assert_json_eq!(
expected_response,
serde_json::Value::from_str(
&String::from_utf8(body_bytes.to_vec())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment