#[cfg(feature = "network_client")]
pub mod client;
pub mod protocol;
pub use protocol::ProtocolError;
#[cfg(feature = "network_client")]
pub use client::reconnect::Client as ReconnClient;
#[cfg(feature = "network_client")]
pub use client::{AsClient, Client, ClientError};
pub use protocol::Config;
#[cfg(feature = "network_client")]
#[deprecated = "use `ClientError` instead"]
pub type Error = client::ClientError;
#[cfg(feature = "internal_test")]
#[cfg(feature = "network_client")]
mod tests {
use super::*;
use crate::test::util::listen_port;
#[crate::test(tarantool = "crate")]
async fn wrong_credentials() {
{
let mut config = Config::default();
config.creds = Some(("no such user".into(), "password".into()));
let client = ReconnClient::with_config("localhost".into(), listen_port(), config);
let err = client.ping().await.unwrap_err();
#[rustfmt::skip]
assert_eq!(err.to_string(), "server responded with error: PasswordMismatch: User not found or supplied credentials are invalid");
}
{
let mut config = Config::default();
config.creds = Some(("test_user".into(), "wrong password".into()));
let client = ReconnClient::with_config("localhost".into(), listen_port(), config);
let err = client.ping().await.unwrap_err();
#[rustfmt::skip]
assert_eq!(err.to_string(), "server responded with error: PasswordMismatch: User not found or supplied credentials are invalid");
}
}
}