Merge dev to main: Security improvements and comprehensive test infrastructure #39
@@ -147,9 +147,12 @@ def test_app(mock_config, temp_auth_file, temp_rbac_file, mock_docker_client):
|
|||||||
"""Create FastAPI test client with mocked dependencies."""
|
"""Create FastAPI test client with mocked dependencies."""
|
||||||
# Patch Docker client before importing main
|
# Patch Docker client before importing main
|
||||||
with patch("docker.DockerClient", return_value=mock_docker_client):
|
with patch("docker.DockerClient", return_value=mock_docker_client):
|
||||||
|
# Mock the limiter to disable rate limiting during tests
|
||||||
|
mock_limiter = Mock()
|
||||||
|
mock_limiter.limit = lambda *args, **kwargs: lambda func: func
|
||||||
|
|
||||||
|
with patch("slowapi.Limiter", return_value=mock_limiter):
|
||||||
from main import app
|
from main import app
|
||||||
# Disable rate limiting during tests to avoid 429 errors
|
|
||||||
app.state.limiter.enabled = False
|
|
||||||
client = TestClient(app)
|
client = TestClient(app)
|
||||||
yield client
|
yield client
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user