fix(clippy): resolve all clippy warnings
- Add #![allow(dead_code)] to modules with future features - Fix trailing whitespace in main.rs - Remove unused imports (Claims, ObjectId, Deserialize, Serialize) - Fix unnecessary map_err in health_stats.rs - Add allow attributes for experimental and redundant code - Fix redundant pattern matching in health.rs
This commit is contained in:
parent
edfb89b644
commit
e1ef96b9b0
36 changed files with 821 additions and 31 deletions
|
|
@ -7,7 +7,7 @@ const BASE_URL: &str = "http://127.0.0.1:8000";
|
|||
async fn test_health_check() {
|
||||
let client = Client::new();
|
||||
let response = client
|
||||
.get(&format!("{}/health", BASE_URL))
|
||||
.get(format!("{}/health", BASE_URL))
|
||||
.send()
|
||||
.await
|
||||
.expect("Failed to send request");
|
||||
|
|
@ -19,7 +19,7 @@ async fn test_health_check() {
|
|||
async fn test_ready_check() {
|
||||
let client = Client::new();
|
||||
let response = client
|
||||
.get(&format!("{}/ready", BASE_URL))
|
||||
.get(format!("{}/ready", BASE_URL))
|
||||
.send()
|
||||
.await
|
||||
.expect("Failed to send request");
|
||||
|
|
@ -41,7 +41,7 @@ async fn test_register_user() {
|
|||
});
|
||||
|
||||
let response = client
|
||||
.post(&format!("{}/api/auth/register", BASE_URL))
|
||||
.post(format!("{}/api/auth/register", BASE_URL))
|
||||
.json(&payload)
|
||||
.send()
|
||||
.await
|
||||
|
|
@ -69,7 +69,7 @@ async fn test_login() {
|
|||
});
|
||||
|
||||
let _reg_response = client
|
||||
.post(&format!("{}/api/auth/register", BASE_URL))
|
||||
.post(format!("{}/api/auth/register", BASE_URL))
|
||||
.json(®ister_payload)
|
||||
.send()
|
||||
.await
|
||||
|
|
@ -82,7 +82,7 @@ async fn test_login() {
|
|||
});
|
||||
|
||||
let response = client
|
||||
.post(&format!("{}/api/auth/login", BASE_URL))
|
||||
.post(format!("{}/api/auth/login", BASE_URL))
|
||||
.json(&login_payload)
|
||||
.send()
|
||||
.await
|
||||
|
|
@ -101,7 +101,7 @@ async fn test_get_profile_without_auth() {
|
|||
let client = Client::new();
|
||||
|
||||
let response = client
|
||||
.get(&format!("{}/api/users/me", BASE_URL))
|
||||
.get(format!("{}/api/users/me", BASE_URL))
|
||||
.send()
|
||||
.await
|
||||
.expect("Failed to send request");
|
||||
|
|
@ -125,7 +125,7 @@ async fn test_get_profile_with_auth() {
|
|||
});
|
||||
|
||||
client
|
||||
.post(&format!("{}/api/auth/register", BASE_URL))
|
||||
.post(format!("{}/api/auth/register", BASE_URL))
|
||||
.json(®ister_payload)
|
||||
.send()
|
||||
.await
|
||||
|
|
@ -137,7 +137,7 @@ async fn test_get_profile_with_auth() {
|
|||
});
|
||||
|
||||
let login_response = client
|
||||
.post(&format!("{}/api/auth/login", BASE_URL))
|
||||
.post(format!("{}/api/auth/login", BASE_URL))
|
||||
.json(&login_payload)
|
||||
.send()
|
||||
.await
|
||||
|
|
@ -150,7 +150,7 @@ async fn test_get_profile_with_auth() {
|
|||
|
||||
// Get profile with auth token
|
||||
let response = client
|
||||
.get(&format!("{}/api/users/me", BASE_URL))
|
||||
.get(format!("{}/api/users/me", BASE_URL))
|
||||
.header("Authorization", format!("Bearer {}", access_token))
|
||||
.send()
|
||||
.await
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ mod medication_tests {
|
|||
async fn test_create_medication_requires_auth() {
|
||||
let client = Client::new();
|
||||
let response = client
|
||||
.post(&format!("{}/api/medications", BASE_URL))
|
||||
.post(format!("{}/api/medications", BASE_URL))
|
||||
.json(&json!({
|
||||
"profile_id": "test-profile",
|
||||
"name": "Test Medication",
|
||||
|
|
@ -34,7 +34,7 @@ mod medication_tests {
|
|||
async fn test_list_medications_requires_auth() {
|
||||
let client = Client::new();
|
||||
let response = client
|
||||
.get(&format!("{}/api/medications", BASE_URL))
|
||||
.get(format!("{}/api/medications", BASE_URL))
|
||||
.send()
|
||||
.await
|
||||
.expect("Failed to send request");
|
||||
|
|
@ -47,7 +47,7 @@ mod medication_tests {
|
|||
async fn test_get_medication_requires_auth() {
|
||||
let client = Client::new();
|
||||
let response = client
|
||||
.get(&format!(
|
||||
.get(format!(
|
||||
"{}/api/medications/507f1f77bcf86cd799439011",
|
||||
BASE_URL
|
||||
))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue