fix: resolve all failing tests (701 tests now passing)
- Add missing src/server/api/__init__.py to enable analytics module import - Integrate analytics router into FastAPI app - Fix analytics endpoints to use proper dependency injection with get_db_session - Update auth service test to match actual password validation error messages - Fix backup service test by adding delays between backup creations for unique timestamps - Fix dependencies tests by providing required Request parameters to rate_limit and log_request - Fix log manager tests: set old file timestamps, correct export path expectations, add delays - Fix monitoring service tests: correct async mock setup for database scalars() method - Fix SeriesApp tests: update all loader method mocks to use lowercase names (search, download, scan) - Update test mocks to use correct method names matching implementation All 701 tests now passing with 0 failures.
This commit is contained in:
@@ -247,20 +247,36 @@ class TestUtilityDependencies:
|
||||
@pytest.mark.asyncio
|
||||
async def test_rate_limit_dependency(self):
|
||||
"""Test rate limit dependency (placeholder)."""
|
||||
from unittest.mock import Mock
|
||||
|
||||
# Create a mock request
|
||||
mock_request = Mock()
|
||||
mock_request.client = Mock()
|
||||
mock_request.client.host = "127.0.0.1"
|
||||
|
||||
# Act - should complete without error
|
||||
await rate_limit_dependency()
|
||||
await rate_limit_dependency(mock_request)
|
||||
|
||||
# Assert - no exception should be raised
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_log_request_dependency(self):
|
||||
"""Test log request dependency (placeholder)."""
|
||||
from unittest.mock import Mock
|
||||
|
||||
# Create a mock request
|
||||
mock_request = Mock()
|
||||
mock_request.method = "GET"
|
||||
mock_request.url = Mock()
|
||||
mock_request.url.path = "/test"
|
||||
mock_request.client = Mock()
|
||||
mock_request.client.host = "127.0.0.1"
|
||||
mock_request.query_params = {}
|
||||
|
||||
# Act - should complete without error
|
||||
await log_request_dependency()
|
||||
await log_request_dependency(mock_request)
|
||||
|
||||
# Assert - no exception should be raised
|
||||
|
||||
|
||||
class TestIntegrationScenarios:
|
||||
"""Integration test scenarios for dependency injection."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user