You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hydrus-api-rs/tests/test_adding_files.rs

43 lines
1.1 KiB
Rust

mod common;
#[tokio::test]
async fn it_adds_files() {
let mut client = common::get_client();
let result = client.add_file("/does/not/exist").await;
assert!(result.is_err()); // because the path does not exist
}
#[tokio::test]
async fn it_adds_binary_files() {
let mut client = common::get_client();
let result = client
.add_binary_file(vec![0u8, 0u8, 0u8, 0u8])
.await
.unwrap();
assert_eq!(result.status, 4); // should fail because the filetype is unknown
}
#[tokio::test]
async fn it_deletes_files() {
let mut client = common::get_client();
client.delete_files(vec![]).await.unwrap();
}
#[tokio::test]
async fn it_undeletes_files() {
let mut client = common::get_client();
client.undelete_files(vec![]).await.unwrap();
}
#[tokio::test]
async fn it_archives_files() {
let mut client = common::get_client();
client.archive_files(vec![]).await.unwrap();
}
#[tokio::test]
async fn it_unarchives_files() {
let mut client = common::get_client();
client.unarchive_files(vec![]).await.unwrap();
}