comment out tests that talk to the api directly

This commit is contained in:
Edgar 2022-11-09 10:40:25 +01:00
parent 2b0fc27b39
commit 2c4661fd3f
5 changed files with 16 additions and 9 deletions

View File

@ -21,6 +21,7 @@ use paypal_rs::{
api::orders::*,
data::orders::*,
data::common::Currency,
PaypalEnv,
};
#[tokio::main]
@ -29,7 +30,7 @@ async fn main() {
let clientid = std::env::var("PAYPAL_CLIENTID").unwrap();
let secret = std::env::var("PAYPAL_SECRET").unwrap();
let mut client = Client::new(clientid, secret, true);
let mut client = Client::new(clientid, secret, PaypalEnv::Sandbox);
client.get_access_token().await.unwrap();

View File

@ -389,6 +389,7 @@ impl super::Client {
}
*/
/*
#[cfg(test)]
mod tests {
use super::*;
@ -433,3 +434,4 @@ mod tests {
Ok(())
}
}
*/

View File

@ -185,7 +185,7 @@ impl Endpoint for AuthorizeOrder {
Some(self.body.clone())
}
}
/*
#[cfg(test)]
mod tests {
use crate::data::common::Currency;
@ -257,3 +257,4 @@ mod tests {
Ok(())
}
}
*/

View File

@ -87,8 +87,8 @@ impl Client {
///
/// # Examples
///
/// ```
/// use paypal_rs::Client;
/// ```no_run
/// use paypal_rs::{Client, PaypalEnv};
///
/// #[tokio::main]
/// async fn main() {
@ -99,7 +99,7 @@ impl Client {
/// let mut client = Client::new(
/// clientid,
/// secret,
/// true,
/// PaypalEnv::Sandbox,
/// );
/// client.get_access_token().await.unwrap();
/// }

View File

@ -14,12 +14,13 @@
//! ## Example
//!
//! ```rust
//! ```no_run
//! use paypal_rs::{
//! Client,
//! api::orders::*,
//! data::orders::*,
//! data::common::Currency,
//! PaypalEnv,
//! };
//!
//! #[tokio::main]
@ -28,7 +29,7 @@
//! let clientid = std::env::var("PAYPAL_CLIENTID").unwrap();
//! let secret = std::env::var("PAYPAL_SECRET").unwrap();
//!
//! let mut client = Client::new(clientid, secret, true);
//! let mut client = Client::new(clientid, secret, PaypalEnv::Sandbox);
//!
//! client.get_access_token().await.unwrap();
//!
@ -175,10 +176,11 @@ struct AuthAssertionClaims {
mod tests {
use crate::countries::Country;
use crate::data::common::Currency;
use crate::Client;
use std::env;
//use crate::Client;
//use std::env;
use std::str::FromStr;
/*
pub async fn create_client() -> Client {
dotenvy::dotenv().ok();
let clientid = env::var("PAYPAL_CLIENTID").unwrap();
@ -186,6 +188,7 @@ mod tests {
Client::new(clientid, secret, crate::PaypalEnv::Sandbox)
}
*/
#[test]
fn test_currency() {