Code formatting
Some checks failed
Rust Build / Check (pull_request) Successful in 48s
Rust Build / Test Suite (pull_request) Failing after 58s
Rust Build / Rustfmt (pull_request) Successful in 26s
Rust Build / Clippy (pull_request) Failing after 46s
Rust Build / build (pull_request) Successful in 47s
Some checks failed
Rust Build / Check (pull_request) Successful in 48s
Rust Build / Test Suite (pull_request) Failing after 58s
Rust Build / Rustfmt (pull_request) Successful in 26s
Rust Build / Clippy (pull_request) Failing after 46s
Rust Build / build (pull_request) Successful in 47s
This commit is contained in:
42
src/main.rs
42
src/main.rs
@@ -41,7 +41,10 @@ mod init {
|
||||
callers::endpoints::LOGIN,
|
||||
post(callers::login::endpoint::login),
|
||||
)
|
||||
.route(callers::endpoints::SERVICE_LOGIN, post(callers::login::endpoint::service_login))
|
||||
.route(
|
||||
callers::endpoints::SERVICE_LOGIN,
|
||||
post(callers::login::endpoint::service_login),
|
||||
)
|
||||
}
|
||||
|
||||
pub async fn app() -> Router {
|
||||
@@ -157,8 +160,11 @@ mod tests {
|
||||
|
||||
pub mod requests {
|
||||
use tower::ServiceExt; // for `call`, `oneshot`, and `ready`
|
||||
|
||||
pub async fn register(app: &axum::Router, usr: &icarus_auth::callers::register::request::Request) -> Result<axum::response::Response, std::convert::Infallible> {
|
||||
|
||||
pub async fn register(
|
||||
app: &axum::Router,
|
||||
usr: &icarus_auth::callers::register::request::Request,
|
||||
) -> Result<axum::response::Response, std::convert::Infallible> {
|
||||
// let usr = super::get_test_register_request();
|
||||
let payload = super::get_test_register_payload(&usr);
|
||||
let req = axum::http::Request::builder()
|
||||
@@ -251,7 +257,6 @@ mod tests {
|
||||
let _ = db_mgr::drop_database(&tm_pool, &db_name).await;
|
||||
}
|
||||
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_login_user() {
|
||||
let tm_pool = db_mgr::get_pool().await.unwrap();
|
||||
@@ -365,7 +370,6 @@ mod tests {
|
||||
"passphrase": passphrase
|
||||
});
|
||||
|
||||
|
||||
match app
|
||||
.oneshot(
|
||||
Request::builder()
|
||||
@@ -375,21 +379,21 @@ mod tests {
|
||||
.body(Body::from(payload.to_string()))
|
||||
.unwrap(),
|
||||
)
|
||||
.await {
|
||||
Ok(response) => {
|
||||
assert_eq!(StatusCode::OK, response.status(), "Status is not right");
|
||||
let body = axum::body::to_bytes(response.into_body(), usize::MAX)
|
||||
.await
|
||||
.unwrap();
|
||||
let parsed_body: callers::login::response::service_login::Response =
|
||||
serde_json::from_slice(&body).unwrap();
|
||||
let _login_result = &parsed_body.data[0];
|
||||
}
|
||||
Err(err) => {
|
||||
assert!(false, "Error: {err:?}");
|
||||
}
|
||||
.await
|
||||
{
|
||||
Ok(response) => {
|
||||
assert_eq!(StatusCode::OK, response.status(), "Status is not right");
|
||||
let body = axum::body::to_bytes(response.into_body(), usize::MAX)
|
||||
.await
|
||||
.unwrap();
|
||||
let parsed_body: callers::login::response::service_login::Response =
|
||||
serde_json::from_slice(&body).unwrap();
|
||||
let _login_result = &parsed_body.data[0];
|
||||
}
|
||||
|
||||
Err(err) => {
|
||||
assert!(false, "Error: {err:?}");
|
||||
}
|
||||
}
|
||||
|
||||
let _ = db_mgr::drop_database(&tm_pool, &db_name).await;
|
||||
}
|
||||
|
Reference in New Issue
Block a user