diff --git a/qbittorrent-web-api-gen/tests/access_search.rs b/qbittorrent-web-api-gen/tests/access_search.rs new file mode 100644 index 0000000..5dbe996 --- /dev/null +++ b/qbittorrent-web-api-gen/tests/access_search.rs @@ -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(()) +} diff --git a/qbittorrent-web-api-gen/tests/tests.rs b/qbittorrent-web-api-gen/tests/tests.rs index 61f2cd2..433c64b 100644 --- a/qbittorrent-web-api-gen/tests/tests.rs +++ b/qbittorrent-web-api-gen/tests/tests.rs @@ -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"); }