From 228f24cb3020b719540fc9665e4aff21528fc69e Mon Sep 17 00:00:00 2001 From: jakka Date: Wed, 1 Oct 2025 12:57:32 +0300 Subject: broke down modules and renamed them --- src/async_lib.rs | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/async_lib.rs (limited to 'src/async_lib.rs') diff --git a/src/async_lib.rs b/src/async_lib.rs new file mode 100644 index 0000000..6bbdd22 --- /dev/null +++ b/src/async_lib.rs @@ -0,0 +1,33 @@ +pub mod client; +pub mod traits; +pub mod types; + +#[cfg(test)] +mod tests { + use crate::async_lib::{client::*, traits::*}; + + #[tokio::test] + async fn test_service_name_info() { + let mut client: HydrusClient = HydrusClient::new("http://127.0.0.1:51251/"); + client.set_api_key("7ab7accf6cf12b2c6c30436cd8fe16361aee33679dbd90da279b5c22b33d622a"); + let _ = client.get_service_name("all my files").await.unwrap(); + } + + #[tokio::test] + async fn test_service_key_info() { + let mut client: HydrusClient = HydrusClient::new("http://127.0.0.1:51251/"); + client.set_api_key("7ab7accf6cf12b2c6c30436cd8fe16361aee33679dbd90da279b5c22b33d622a"); + let _ = client + .get_service_key("616c6c206c6f63616c206d65646961") + .await + .unwrap(); + } + + #[tokio::test] + async fn test_get_services() { + let mut client: HydrusClient = HydrusClient::new("http://127.0.0.1:51251/"); + client.set_api_key("7ab7accf6cf12b2c6c30436cd8fe16361aee33679dbd90da279b5c22b33d622a"); + let res = client.get_services().await.unwrap(); + assert!(!res.is_empty()) + } +} -- cgit v1.3.1