mirror of
https://github.com/librespot-org/librespot.git
synced 2024-11-08 16:45:43 +00:00
Fix connect test
This commit is contained in:
parent
2065ded7b6
commit
fcb21df81f
1 changed files with 5 additions and 10 deletions
|
@ -1,20 +1,15 @@
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
use librespot_core::authentication::Credentials;
|
|
||||||
use librespot_core::config::SessionConfig;
|
|
||||||
use librespot_core::session::Session;
|
|
||||||
|
|
||||||
use tokio::time::timeout;
|
use tokio::time::timeout;
|
||||||
|
|
||||||
|
use librespot_core::{authentication::Credentials, config::SessionConfig, session::Session};
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_connection() {
|
async fn test_connection() {
|
||||||
timeout(Duration::from_secs(30), async {
|
timeout(Duration::from_secs(30), async {
|
||||||
let result = Session::connect(
|
let result = Session::new(SessionConfig::default(), None)
|
||||||
SessionConfig::default(),
|
.connect(Credentials::with_password("test", "test"))
|
||||||
Credentials::with_password("test", "test"),
|
.await;
|
||||||
None,
|
|
||||||
)
|
|
||||||
.await;
|
|
||||||
|
|
||||||
match result {
|
match result {
|
||||||
Ok(_) => panic!("Authentication succeeded despite of bad credentials."),
|
Ok(_) => panic!("Authentication succeeded despite of bad credentials."),
|
||||||
|
|
Loading…
Reference in a new issue