comment out tests that talk to the api directly
This commit is contained in:
parent
2b0fc27b39
commit
2c4661fd3f
|
@ -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();
|
||||
|
||||
|
|
|
@ -389,6 +389,7 @@ impl super::Client {
|
|||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
@ -433,3 +434,4 @@ mod tests {
|
|||
Ok(())
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
|
|
@ -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(())
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
|
|
@ -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();
|
||||
/// }
|
||||
|
|
11
src/lib.rs
11
src/lib.rs
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue