mod exchange_test; use tracing::{instrument}; use exchanges::bitget_spot_ws::{BitgetSpotSubscribeType}; use standard::exchange::ExchangeEnum; use crate::exchange_test::test_new_exchange_wss; const SYMBOL: &str = "BLZ_USDT"; // 测试订阅深度订阅 #[tokio::test(flavor = "multi_thread", worker_threads = 4)] #[instrument(level = "TRACE")] async fn test_get_wss_depth() { global::log_utils::init_log_with_trace(); let bitget_subscribe_type = vec![ BitgetSpotSubscribeType::PuBooks5 ]; test_new_exchange_wss(ExchangeEnum::BitgetSpot, SYMBOL, bitget_subscribe_type, "depth").await; } // 测试订阅Ticker信息 #[tokio::test(flavor = "multi_thread", worker_threads = 4)] #[instrument(level = "TRACE")] async fn test_get_wss_ticker() { global::log_utils::init_log_with_trace(); let bitget_subscribe_type = vec![ BitgetSpotSubscribeType::PuTicker ]; test_new_exchange_wss(ExchangeEnum::BitgetSpot, SYMBOL, bitget_subscribe_type, "ticker").await; } // 测试订阅Account信息 #[tokio::test(flavor = "multi_thread", worker_threads = 4)] #[instrument(level = "TRACE")] async fn test_get_wss_account() { global::log_utils::init_log_with_trace(); let bitget_subscribe_type = vec![ BitgetSpotSubscribeType::PrAccount ]; test_new_exchange_wss(ExchangeEnum::BitgetSpot, SYMBOL, bitget_subscribe_type, "account").await; } // 测试订阅Orders信息 #[tokio::test(flavor = "multi_thread", worker_threads = 4)] #[instrument(level = "TRACE")] async fn test_get_wss_orders() { global::log_utils::init_log_with_trace(); let bitget_subscribe_type = vec![ BitgetSpotSubscribeType::PrOrders ]; test_new_exchange_wss(ExchangeEnum::BitgetSpot, SYMBOL, bitget_subscribe_type, "orders").await; }