fix warnings
This commit is contained in:
parent
9aa972dd5c
commit
d5d29fb016
|
@ -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"
|
||||
|
|
|
@ -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(())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue