From 2d83c1db9fdf316cb69f3568b0e56df1f4d39c23 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 27 Nov 2021 10:47:51 +0100 Subject: Fix test implementation Signed-off-by: Matthias Beyer --- Cargo.toml | 2 +- src/client.rs | 5 +++-- src/ipfs_client.rs | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 892ba37..91ed946 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,4 +38,4 @@ libp2p-ping = "*" rand_core = { version = "0.6", features = ["getrandom"] } rand_os = "0.2" ed25519-dalek = "*" - +http = "0.2" diff --git a/src/client.rs b/src/client.rs index 8a9a276..e89268a 100644 --- a/src/client.rs +++ b/src/client.rs @@ -36,6 +36,7 @@ impl Client { #[cfg(test)] mod tests { + use ipfs_api_backend_hyper::TryFromUri; use crate::client::Client; use crate::config::Config; use crate::ipfs_client::IpfsClient; @@ -44,9 +45,9 @@ mod tests { fn test_post_text_blob() { let ipfs = IpfsClient::from_str("http://localhost:5001").unwrap(); let config = Config::default(); - let client = Client::new(ifps, config); + let client = Client::new(ipfs, config); - let cid = Client.post_text_blob(String::from("text")); + let cid = client.post_text_blob(String::from("text")); assert!(cid.is_ok()); } diff --git a/src/ipfs_client.rs b/src/ipfs_client.rs index a4b3710..1bf014f 100644 --- a/src/ipfs_client.rs +++ b/src/ipfs_client.rs @@ -2,6 +2,7 @@ pub type IpfsClient = ipfs_api_backend_hyper::IpfsClient; #[cfg(test)] mod tests { + use ipfs_api_backend_hyper::TryFromUri; use super::IpfsClient; #[test] @@ -11,6 +12,6 @@ mod tests { #[test] fn test_connect_host_and_port() { - let _ = IpfsClient::from_host_and_port("localhost", 5001).unwrap(); + let _ = IpfsClient::from_host_and_port(http::uri::Scheme::HTTP, "localhost", 5001).unwrap(); } } -- cgit v1.2.3