style: apply ruff auto-fix
- Auto-formatted code with ruff format - Applied ruff linting fixes with --fix Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
@@ -371,7 +371,6 @@ class TestAzureTestConnectionIntegration:
|
||||
data = response.json()
|
||||
assert "status" in data
|
||||
|
||||
|
||||
@patch("app.api.azure.settings")
|
||||
@patch("app.api.azure.logger")
|
||||
@pytest.mark.asyncio
|
||||
@@ -518,6 +517,7 @@ class TestAzureTestConnectionIntegration:
|
||||
async def test_azure_connection_logs_outer_exception(self, mock_logger, mock_settings):
|
||||
"""Test that exceptions in outer try block are logged with exception()."""
|
||||
from unittest.mock import PropertyMock
|
||||
|
||||
from app.api.azure import test_azure_connection
|
||||
|
||||
# Trigger an exception in the outer try block
|
||||
@@ -545,6 +545,7 @@ class TestAzureTestConnectionIntegration:
|
||||
):
|
||||
"""Test that warning is logged when operations parsing fails."""
|
||||
from unittest.mock import PropertyMock
|
||||
|
||||
from app.api.azure import test_azure_connection
|
||||
|
||||
mock_settings.azure_endpoint = "https://test.cognitiveservices.azure.com/"
|
||||
@@ -575,6 +576,7 @@ class TestAzureTestConnectionIntegration:
|
||||
async def test_azure_connection_outer_exception_handler(self, mock_settings):
|
||||
"""Test the outer exception handler catches unexpected errors."""
|
||||
from unittest.mock import PropertyMock
|
||||
|
||||
from app.api.azure import test_azure_connection
|
||||
|
||||
# Create a mock that raises exception when azure_endpoint is accessed using PropertyMock
|
||||
|
||||
@@ -318,7 +318,9 @@ class TestLogTaskProgressWithFileProcessingStep:
|
||||
mock_db.query.return_value.filter.return_value.first.return_value = None
|
||||
|
||||
# Mock datetime
|
||||
from datetime import datetime as dt, timezone
|
||||
from datetime import datetime as dt
|
||||
from datetime import timezone
|
||||
|
||||
mock_now = dt(2024, 1, 1, 12, 0, 0, tzinfo=timezone.utc)
|
||||
mock_datetime.now.return_value = mock_now
|
||||
mock_datetime.timezone = timezone
|
||||
@@ -359,7 +361,9 @@ class TestLogTaskProgressWithFileProcessingStep:
|
||||
|
||||
mock_db.query.return_value.filter.return_value.first.return_value = None
|
||||
|
||||
from datetime import datetime as dt, timezone
|
||||
from datetime import datetime as dt
|
||||
from datetime import timezone
|
||||
|
||||
mock_now = dt(2024, 1, 1, 12, 0, 0, tzinfo=timezone.utc)
|
||||
mock_datetime.now.return_value = mock_now
|
||||
mock_datetime.timezone = timezone
|
||||
@@ -396,7 +400,9 @@ class TestLogTaskProgressWithFileProcessingStep:
|
||||
|
||||
mock_db.query.return_value.filter.return_value.first.return_value = None
|
||||
|
||||
from datetime import datetime as dt, timezone
|
||||
from datetime import datetime as dt
|
||||
from datetime import timezone
|
||||
|
||||
mock_now = dt(2024, 1, 1, 12, 0, 0, tzinfo=timezone.utc)
|
||||
mock_datetime.now.return_value = mock_now
|
||||
mock_datetime.timezone = timezone
|
||||
@@ -434,7 +440,9 @@ class TestLogTaskProgressWithFileProcessingStep:
|
||||
mock_existing_step.started_at = None
|
||||
mock_db.query.return_value.filter.return_value.first.return_value = mock_existing_step
|
||||
|
||||
from datetime import datetime as dt, timezone
|
||||
from datetime import datetime as dt
|
||||
from datetime import timezone
|
||||
|
||||
mock_now = dt(2024, 1, 1, 12, 0, 0, tzinfo=timezone.utc)
|
||||
mock_datetime.now.return_value = mock_now
|
||||
mock_datetime.timezone = timezone
|
||||
@@ -467,7 +475,9 @@ class TestLogTaskProgressWithFileProcessingStep:
|
||||
mock_existing_step.started_at = None
|
||||
mock_db.query.return_value.filter.return_value.first.return_value = mock_existing_step
|
||||
|
||||
from datetime import datetime as dt, timezone
|
||||
from datetime import datetime as dt
|
||||
from datetime import timezone
|
||||
|
||||
mock_now = dt(2024, 1, 1, 12, 0, 0, tzinfo=timezone.utc)
|
||||
mock_datetime.now.return_value = mock_now
|
||||
mock_datetime.timezone = timezone
|
||||
|
||||
Reference in New Issue
Block a user