fix warnings

This commit is contained in:
Edgar 2022-04-08 09:20:42 +02:00
parent 9aa972dd5c
commit d5d29fb016
No known key found for this signature in database
GPG key ID: 8731E6C0166EAA85
2 changed files with 6 additions and 8 deletions

View file

@ -26,3 +26,4 @@ bytes = "1.1.0"
[dev-dependencies]
tokio = { version = "1.17.0", features = ["macros", "rt-multi-thread"] }
dotenv = "0.15.0"
anyhow = "1.0.56"

View file

@ -891,24 +891,21 @@ impl super::Client {
#[cfg(test)]
mod tests {
use crate::{invoice::*, Client, HeaderParams};
use crate::{Client, HeaderParams};
async fn create_client() -> Client {
dotenv::dotenv().ok();
let clientid = std::env::var("PAYPAL_CLIENTID").unwrap();
let secret = std::env::var("PAYPAL_SECRET").unwrap();
let client = Client::new(clientid, secret, true);
client
Client::new(clientid, secret, true)
}
#[tokio::test]
async fn test_invoice() {
async fn test_invoice() -> anyhow::Result<()> {
let mut client = create_client().await;
let list = client.list_invoices(1, 10, HeaderParams::default()).await.unwrap();
println!("{:#?}", list);
let _list = client.list_invoices(1, 10, HeaderParams::default()).await?;
Ok(())
}
}