#![cfg(feature = "integration-tests")]
use std::env;
use open_lark::prelude::*;
#[test]
fn test_build_client_from_env() -> Result<(), Box<dyn std::error::Error>> {
let _ = dotenvy::dotenv();
let app_id = env::var("APP_ID").ok();
let app_secret = env::var("APP_SECRET").ok();
if app_id.is_none() || app_secret.is_none() {
eprintln!(
"[integration-tests] 跳过:未设置 APP_ID/APP_SECRET 环境变量"
);
return Ok(());
}
let app_id = app_id.unwrap();
let app_secret = app_secret.unwrap();
let client = LarkClient::builder(&app_id, &app_secret)
.with_app_type(AppType::SelfBuild)
.build();
assert_eq!(client.config.app_id, app_id);
assert_eq!(client.config.app_secret, app_secret);
Ok(())
}