#[cfg(test)]
mod tests {
use crate::yuque::Yuque;
#[tokio::test]
async fn test_get_auth_user() {
let token = option_env!("YUQUE_TOKEN").unwrap_or_default().to_string();
let yuque = Yuque::new(token).unwrap();
let user = yuque.get_auth_user().await.unwrap();
assert_eq!(user.name, "K8sCat")
}
#[tokio::test]
async fn test_get_user() {
let token = option_env!("YUQUE_TOKEN").unwrap_or_default().to_string();
let yuque = Yuque::new(token).unwrap();
let user = yuque.get_user(565457).await.unwrap();
assert_eq!(user.name, "K8sCat")
}
}
#[tokio::test]
支持异步方法的测试- assert_eq!,assert_ne!,