qbittorrent_web_api/api-gen/tests/without_parameters.rs
2022-07-10 17:06:19 +02:00

21 lines
485 B
Rust

use anyhow::Result;
use 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 version = api.application().version().await?;
// don't be too specific
assert!(version.starts_with("v4.4"), "got: {}", version);
Ok(())
}