fix: Update test configurations and improve Home Assistant route tests
Some checks failed
Integration Tests / performance-tests (push) Has been skipped
LabFusion CI/CD Pipeline / api-docs (push) Successful in 1m47s
LabFusion CI/CD Pipeline / frontend (push) Failing after 2m2s
LabFusion CI/CD Pipeline / integration-tests (push) Has been skipped
Docker Build and Push / build-and-push (push) Failing after 39s
LabFusion CI/CD Pipeline / service-adapters (push) Successful in 56s
LabFusion CI/CD Pipeline / api-gateway (push) Failing after 1m21s
Integration Tests / integration-tests (push) Failing after 35s
Service Adapters (Python FastAPI) / test (3.1) (push) Failing after 13s
Service Adapters (Python FastAPI) / test (3.11) (push) Failing after 43s
Service Adapters (Python FastAPI) / test (3.9) (push) Failing after 44s
Service Adapters (Python FastAPI) / test (3.12) (push) Failing after 47s
Service Adapters (Python FastAPI) / build (push) Has been skipped
Some checks failed
Integration Tests / performance-tests (push) Has been skipped
LabFusion CI/CD Pipeline / api-docs (push) Successful in 1m47s
LabFusion CI/CD Pipeline / frontend (push) Failing after 2m2s
LabFusion CI/CD Pipeline / integration-tests (push) Has been skipped
Docker Build and Push / build-and-push (push) Failing after 39s
LabFusion CI/CD Pipeline / service-adapters (push) Successful in 56s
LabFusion CI/CD Pipeline / api-gateway (push) Failing after 1m21s
Integration Tests / integration-tests (push) Failing after 35s
Service Adapters (Python FastAPI) / test (3.1) (push) Failing after 13s
Service Adapters (Python FastAPI) / test (3.11) (push) Failing after 43s
Service Adapters (Python FastAPI) / test (3.9) (push) Failing after 44s
Service Adapters (Python FastAPI) / test (3.12) (push) Failing after 47s
Service Adapters (Python FastAPI) / build (push) Has been skipped
### Summary of Changes - Added `--asyncio-mode=auto` to `pytest.ini` for better async test handling. - Corrected patch decorators in `test_general_routes.py` and `test_home_assistant_routes.py` to reference the correct services. - Enhanced test assertions in `test_home_assistant_routes.py` to verify service availability and response codes. - Improved clarity and maintainability of test code by applying clean code principles. ### Expected Results - Improved test execution for asynchronous code and better organization of test cases. - Enhanced reliability of Home Assistant route tests, ensuring accurate service behavior verification.
This commit is contained in:
@@ -34,7 +34,7 @@ class TestGeneralRoutes:
|
||||
# Verify timestamp is in ISO format
|
||||
assert "T" in data["timestamp"] or "Z" in data["timestamp"]
|
||||
|
||||
@patch("services.config.SERVICES")
|
||||
@patch("routes.general.SERVICES")
|
||||
def test_get_services(self, mock_services):
|
||||
"""Test the get services endpoint"""
|
||||
# Mock the services configuration
|
||||
|
||||
Reference in New Issue
Block a user