librespot/core/tests/connect.rs

35 lines
1.2 KiB
Rust
Raw Normal View History

2021-01-21 20:56:23 +00:00
use librespot_core::*;
2021-03-01 02:37:22 +00:00
// TODO: test is broken
// #[cfg(test)]
// mod tests {
// use super::*;
// // Test AP Resolve
// use apresolve::apresolve_or_fallback;
// #[tokio::test]
// async fn test_ap_resolve() {
// env_logger::init();
// let ap = apresolve_or_fallback(&None, &None).await;
// println!("AP: {:?}", ap);
// }
2021-01-21 20:56:23 +00:00
2021-03-01 02:37:22 +00:00
// // Test connect
// use authentication::Credentials;
// use config::SessionConfig;
// #[tokio::test]
// async fn test_connection() -> Result<(), Box<dyn std::error::Error>> {
// println!("Running connection test");
// let ap = apresolve_or_fallback(&None, &None).await;
// let credentials = Credentials::with_password(String::from("test"), String::from("test"));
// let session_config = SessionConfig::default();
// let proxy = None;
2021-01-21 20:56:23 +00:00
2021-03-01 02:37:22 +00:00
// println!("Connecting to AP \"{}\"", ap);
// let mut connection = connection::connect(ap, &proxy).await?;
// let rc = connection::authenticate(&mut connection, credentials, &session_config.device_id)
// .await?;
// println!("Authenticated as \"{}\"", rc.username);
// Ok(())
// }
// }