summaryrefslogtreecommitdiff
path: root/tests/sync.rs
diff options
context:
space:
mode:
authorjakka <jakka@jakka.su>2025-10-17 17:08:43 +0300
committerjakka <jakka@jakka.su>2025-10-17 17:08:43 +0300
commit27b33c13ba8cc7c4980abde2cf4a4331396376df (patch)
treead6ca5c1a1a45d399e27ecc9848b48d685faed46 /tests/sync.rs
parent38ea76f490a94b5734d4b39ca0c0be2e6ab6f90a (diff)
various fixes
reorganized project structure so client tests are not in the libraries changed some types on functions for better use
Diffstat (limited to 'tests/sync.rs')
-rw-r--r--tests/sync.rs33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/sync.rs b/tests/sync.rs
new file mode 100644
index 0000000..b37b9db
--- /dev/null
+++ b/tests/sync.rs
@@ -0,0 +1,33 @@
+use hydrus_api_rs::sync_lib::client::HydrusClient;
+use hydrus_api_rs::sync_lib::traits::*;
+use std::path::PathBuf;
+
+#[test]
+fn test_service_name_info() {
+ let keyfile = PathBuf::from("secrets");
+ let key = std::fs::read_to_string(keyfile).unwrap().trim().to_string();
+ let mut client: HydrusClient = HydrusClient::new("http://127.0.0.1:45869/");
+ client.set_api_key(key);
+ let _ = client.get_service_name("all my files").unwrap();
+}
+
+#[test]
+fn test_service_key_info() {
+ let keyfile = PathBuf::from("secrets");
+ let mut client: HydrusClient = HydrusClient::new("http://127.0.0.1:45869/");
+ let key = std::fs::read_to_string(keyfile).unwrap().trim().to_string();
+ client.set_api_key(key);
+ let _ = client
+ .get_service_key("616c6c206c6f63616c206d65646961")
+ .unwrap();
+}
+
+#[test]
+fn test_get_services() {
+ let mut client: HydrusClient = HydrusClient::new("http://127.0.0.1:45869/");
+ let keyfile = PathBuf::from("secrets");
+ let key = std::fs::read_to_string(keyfile).unwrap().trim().to_string();
+ client.set_api_key(key);
+ let res = client.get_services().unwrap();
+ assert!(!res.is_empty())
+}