mirror of
https://github.com/kristoferssolo/transmission-rpc.git
synced 2025-12-30 13:21:49 +00:00
Make test_malformed_url work with no BasicAuth
This commit is contained in:
parent
c75029f59e
commit
23330680d6
11
src/lib.rs
11
src/lib.rs
@ -380,11 +380,12 @@ mod tests {
|
||||
dotenv().ok();
|
||||
env_logger::init();
|
||||
let url = env::var("TURL")?;
|
||||
let basic_auth = BasicAuth {
|
||||
user: env::var("TUSER")?,
|
||||
password: env::var("TPWD")?,
|
||||
};
|
||||
let client = TransClient::with_auth(&url, basic_auth);
|
||||
let client;
|
||||
if let (Ok(user), Ok(password)) = (env::var("TUSER"), env::var("TPWD")) {
|
||||
client = TransClient::with_auth(&url, BasicAuth {user, password});
|
||||
} else {
|
||||
client = TransClient::new(&url);
|
||||
}
|
||||
info!("Client is ready!");
|
||||
let add: TorrentAddArgs = TorrentAddArgs {
|
||||
filename: Some(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user