fixed tests

This commit is contained in:
Jędrzej Stuczyński
2024-05-03 17:14:26 +01:00
parent 1ecb57fda0
commit fc71e0cafd
3 changed files with 5 additions and 2 deletions
Generated
+1
View File
@@ -5110,6 +5110,7 @@ dependencies = [
"fastrand 2.1.0",
"headers",
"hmac 0.12.1",
"hyper 1.3.1",
"ipnetwork 0.16.0",
"nym-crypto",
"nym-http-api-common",
+1
View File
@@ -38,6 +38,7 @@ nym-wireguard = { path = "../../common/wireguard" }
nym-wireguard-types = { path = "../../common/wireguard-types", features = ["verify"] }
[dev-dependencies]
hyper.workspace = true
dashmap.workspace = true
serde_json.workspace = true
@@ -104,6 +104,7 @@ mod test {
use crate::api::v1::gateway::client_interfaces::wireguard::{
routes, WireguardAppState, WireguardAppStateInner,
};
use axum::body::to_bytes;
use axum::body::Body;
use axum::http::Request;
use axum::http::StatusCode;
@@ -203,7 +204,7 @@ mod test {
nonce,
gateway_data,
wg_port: 8080,
} = serde_json::from_slice(&hyper::body::to_bytes(response.into_body()).await.unwrap())
} = serde_json::from_slice(&to_bytes(response.into_body(), usize::MAX).await.unwrap())
.unwrap()
else {
panic!("invalid response")
@@ -257,7 +258,7 @@ mod test {
assert_eq!(response.status(), StatusCode::OK);
let clients: Vec<PeerPublicKey> =
serde_json::from_slice(&hyper::body::to_bytes(response.into_body()).await.unwrap())
serde_json::from_slice(&to_bytes(response.into_body(), usize::MAX).await.unwrap())
.unwrap();
assert!(!clients.is_empty());