chore(lint): apply ruff --fix (4443 auto-fixes)
Auto-fixed categories: - F401: unused imports removed - I001: import blocks sorted - W293: trailing whitespace stripped - UP035: deprecated typing imports replaced - SIM: simplify suggestions applied - ARG: unused args prefixed with underscore - T201: print statements removed - F841: unused variables removed - RUF059: unpacked variables prefixed Remaining ~1500 unfixable errors (C901, B904, N806, E402) require manual work. Backend smoke tests: 13/13 passed.
This commit is contained in:
@@ -3,24 +3,26 @@
|
||||
# @PURPOSE: Comprehensive contract-driven tests for Dashboard Hub API
|
||||
# @LAYER: Domain (Tests)
|
||||
# @SEMANTICS: tests, dashboards, api, contract, remediation
|
||||
from datetime import UTC, datetime
|
||||
from unittest.mock import AsyncMock, MagicMock, patch
|
||||
|
||||
import pytest
|
||||
from fastapi.testclient import TestClient
|
||||
from unittest.mock import MagicMock, patch, AsyncMock
|
||||
from datetime import datetime, timezone
|
||||
from src.app import app
|
||||
|
||||
from src.api.routes.dashboards import (
|
||||
DashboardsResponse,
|
||||
DashboardDetailResponse,
|
||||
DashboardsResponse,
|
||||
DashboardTaskHistoryResponse,
|
||||
DatabaseMappingsResponse,
|
||||
)
|
||||
from src.app import app
|
||||
from src.dependencies import (
|
||||
get_current_user,
|
||||
has_permission,
|
||||
get_config_manager,
|
||||
get_task_manager,
|
||||
get_resource_service,
|
||||
get_current_user,
|
||||
get_mapping_service,
|
||||
get_resource_service,
|
||||
get_task_manager,
|
||||
has_permission,
|
||||
)
|
||||
|
||||
# Global mock user
|
||||
@@ -299,7 +301,7 @@ def test_get_dashboard_detail_env_not_found(mock_deps):
|
||||
# [DEF:test_get_dashboard_tasks_history_success:Function]
|
||||
# @RELATION: BINDS_TO ->[TestDashboardsApi]
|
||||
def test_get_dashboard_tasks_history_success(mock_deps):
|
||||
now = datetime.now(timezone.utc)
|
||||
now = datetime.now(UTC)
|
||||
task1 = MagicMock(
|
||||
id="t1",
|
||||
plugin_id="superset-backup",
|
||||
@@ -328,7 +330,7 @@ def test_get_dashboard_tasks_history_sorting(mock_deps):
|
||||
"""@POST: Response contains sorted task history (newest first)."""
|
||||
from datetime import timedelta
|
||||
|
||||
now = datetime.now(timezone.utc)
|
||||
now = datetime.now(UTC)
|
||||
older = now - timedelta(hours=2)
|
||||
newest = now
|
||||
|
||||
|
||||
Reference in New Issue
Block a user