✅ Task 1: Security middleware tests (95% coverage)
- Created 48 comprehensive tests for security middleware - Coverage: security.py 97%, auth.py 92%, total 95% - Tests for SecurityHeadersMiddleware, CSP, RequestSanitization - Tests for rate limiting (IP-based, origin-based, cleanup) - Fixed MutableHeaders.pop() bug in security.py - All tests passing, exceeds 90% target
This commit is contained in:
@@ -466,9 +466,10 @@ class TestNFOServiceDependency:
|
||||
This test verifies that when the NFO service dependency raises an
|
||||
HTTPException 503 due to missing TMDB API key, the endpoint returns 503.
|
||||
"""
|
||||
from src.server.api.nfo import get_nfo_service
|
||||
from fastapi import HTTPException, status
|
||||
|
||||
|
||||
from src.server.api.nfo import get_nfo_service
|
||||
|
||||
# Create a dependency that raises HTTPException 503 (simulating missing API key)
|
||||
async def fail_nfo_service():
|
||||
raise HTTPException(
|
||||
|
||||
Reference in New Issue
Block a user