diff --git a/Cargo.toml b/Cargo.toml index c134102..fc1ecea 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/src/invoice.rs b/src/invoice.rs index ced3505..13dc4b6 100644 --- a/src/invoice.rs +++ b/src/invoice.rs @@ -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(()) } }