fix: Clean up and standardize test code formatting
Some checks failed
LabFusion CI/CD Pipeline / service-adapters (push) Failing after 20s
Docker Build and Push / build-and-push (push) Failing after 37s
Integration Tests / integration-tests (push) Failing after 32s
Integration Tests / performance-tests (push) Has been skipped
Service Adapters (Python FastAPI) / test (3.1) (push) Failing after 15s
LabFusion CI/CD Pipeline / api-gateway (push) Failing after 1m18s
Service Adapters (Python FastAPI) / test (3.11) (push) Failing after 22s
Service Adapters (Python FastAPI) / test (3.12) (push) Failing after 23s
Service Adapters (Python FastAPI) / test (3.9) (push) Failing after 21s
LabFusion CI/CD Pipeline / frontend (push) Failing after 2m0s
Service Adapters (Python FastAPI) / build (push) Has been skipped
LabFusion CI/CD Pipeline / api-docs (push) Successful in 1m53s
LabFusion CI/CD Pipeline / integration-tests (push) Has been skipped

### Summary of Changes
- Removed unnecessary blank lines and standardized import statements across test files.
- Ensured consistent use of quotes in patch decorators and improved formatting of test data structures.
- Enhanced readability and maintainability of test code by applying clean code principles.

### Expected Results
- Improved clarity and consistency in test code, facilitating easier understanding and future modifications.
This commit is contained in:
GSRN
2025-09-15 21:12:15 +02:00
parent 64d4e405c5
commit 8c37bff103
6 changed files with 82 additions and 114 deletions

View File

@@ -1,7 +1,7 @@
"""
Tests for the main FastAPI application
"""
import pytest
from fastapi.testclient import TestClient
from main import app
@@ -30,12 +30,12 @@ class TestMainApp:
"""Test that all routers are included"""
# Check that all expected routes are available
routes = [route.path for route in app.routes]
# General routes
assert "/" in routes
assert "/health" in routes
assert "/services" in routes
# Other service routes should be included
# (exact paths depend on router definitions)
@@ -43,7 +43,7 @@ class TestMainApp:
"""Test that OpenAPI documentation is available"""
response = client.get("/docs")
assert response.status_code == 200
response = client.get("/openapi.json")
assert response.status_code == 200
assert "openapi" in response.json()