Add search tests

This commit is contained in:
Joel Wachsler 2022-07-14 10:30:31 +00:00
parent 3ffc5a548f
commit 3ba7ee65c8
2 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,21 @@
use anyhow::Result;
use qbittorrent_web_api_gen::QBittorrentApiGen;
const USERNAME: &str = "admin";
const PASSWORD: &str = "adminadmin";
const BASE_URL: &str = "http://localhost:8080";
#[derive(QBittorrentApiGen)]
struct Api {}
#[tokio::main]
async fn main() -> Result<()> {
let api = Api::login(BASE_URL, USERNAME, PASSWORD).await?;
let _ = api.search().delete(1).send().await?;
let _ = api.search().plugins().await?;
let _ = api.search().plugins().await?;
let _ = api.search().install_plugin("https://raw.githubusercontent.com/qbittorrent/search-plugins/master/nova3/engines/legittorrents.py").send().await?;
Ok(())
}

View File

@ -19,4 +19,5 @@ fn tests() {
t.pass("tests/add_torrent.rs");
t.pass("tests/another_struct_name.rs");
t.pass("tests/access_impl_types.rs");
t.pass("tests/search_types.rs");
}