mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +00:00
690e0d2e10
The first test checks whether apresolve works. A second test tries to create a Spotify sessions with fake credentials and asserts that an error is returned.
18 lines
528 B
Rust
18 lines
528 B
Rust
use librespot_core::authentication::Credentials;
|
|
use librespot_core::config::SessionConfig;
|
|
use librespot_core::session::Session;
|
|
|
|
#[tokio::test]
|
|
async fn test_connection() {
|
|
let result = Session::connect(
|
|
SessionConfig::default(),
|
|
Credentials::with_password("test", "test"),
|
|
None,
|
|
)
|
|
.await;
|
|
|
|
match result {
|
|
Ok(_) => panic!("Authentication succeeded despite of bad credentials."),
|
|
Err(e) => assert_eq!(e.to_string(), "Login failed with reason: Bad credentials"),
|
|
};
|
|
}
|