diff options
| author | jakka <jakka@jakka.su> | 2025-10-01 12:57:32 +0300 |
|---|---|---|
| committer | jakka <jakka@jakka.su> | 2025-10-01 12:57:32 +0300 |
| commit | 228f24cb3020b719540fc9665e4aff21528fc69e (patch) | |
| tree | 83194bfda6c6d97ffec81aef2545802b859b4e5f /src/async_lib.rs | |
| parent | c177ba7a49caf63582719a4086e5032e2c939cfa (diff) | |
broke down modules and renamed them
Diffstat (limited to 'src/async_lib.rs')
| -rw-r--r-- | src/async_lib.rs | 33 |
1 files changed, 33 insertions, 0 deletions
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()) + } +} |
