diff options
Diffstat (limited to 'src/tests.rs')
| -rw-r--r-- | src/tests.rs | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/tests.rs b/src/tests.rs index 3fafdbe..9dc56e1 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -8,7 +8,7 @@ fn correct_hydruspermissions_url_encode() { HydrusPermissions::ImportAndEditFiles, HydrusPermissions::SeeLocalPaths, ]; - let json_string = musli::json::to_string(&perms).unwrap(); + let json_string = serde_json::to_string(&perms).unwrap(); let encoded = urlencoding::encode(&json_string); assert_eq!(encoded, "%5B0%2C1%2C13%5D") @@ -21,9 +21,9 @@ fn correct_hydruspermissions_decode() { HydrusPermissions::ImportAndEditFiles, HydrusPermissions::SeeLocalPaths, ]; - let json_string = musli::json::to_string(&perms).unwrap(); + let json_string = serde_json::to_string(&perms).unwrap(); - let res: [HydrusPermissions; 3] = musli::json::from_str(&json_string).unwrap(); + let res: [HydrusPermissions; 3] = serde_json::from_str(&json_string).unwrap(); assert_eq!(res, perms) } @@ -35,14 +35,16 @@ fn correct_hydrusservice_decode() { ServiceType::Trash, ]; - let json_string = musli::json::to_string(&input).unwrap(); + let json_string = serde_json::to_string(&input).unwrap(); - let res: [ServiceType; 3] = musli::json::from_str(&json_string).unwrap(); + let res: [ServiceType; 3] = serde_json::from_str(&json_string).unwrap(); assert_eq!(res, input) } #[test] -fn get_keys() { - let client: HydrusClient = HydrusClient::new("http://127.0.0.1:51251/"); - let _ = client.request_new_permissions("test client", &[]).unwrap(); +fn client_test() { + let mut client: HydrusClient = HydrusClient::new("http://127.0.0.1:51251/"); + client.set_api_key("7ab7accf6cf12b2c6c30436cd8fe16361aee33679dbd90da279b5c22b33d622a"); + let test = client.get_services().unwrap(); + println!("{:?}", test); } |
