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:
@@ -19,11 +19,11 @@ from app.utils.ai_provider import (
|
|||||||
get_ai_provider,
|
get_ai_provider,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Helpers
|
# Helpers
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
def _make_openai_response(content: str) -> MagicMock:
|
def _make_openai_response(content: str) -> MagicMock:
|
||||||
"""Build a minimal mock that looks like an openai ChatCompletion response."""
|
"""Build a minimal mock that looks like an openai ChatCompletion response."""
|
||||||
msg = SimpleNamespace(content=content)
|
msg = SimpleNamespace(content=content)
|
||||||
@@ -55,6 +55,7 @@ def _make_none_content_response() -> MagicMock:
|
|||||||
# _require_text_content helper
|
# _require_text_content helper
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.unit
|
@pytest.mark.unit
|
||||||
class TestRequireTextContent:
|
class TestRequireTextContent:
|
||||||
"""Tests for the _require_text_content guard helper."""
|
"""Tests for the _require_text_content guard helper."""
|
||||||
@@ -77,6 +78,7 @@ class TestRequireTextContent:
|
|||||||
# Abstract base class
|
# Abstract base class
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.unit
|
@pytest.mark.unit
|
||||||
class TestAIProviderABC:
|
class TestAIProviderABC:
|
||||||
"""Verify that AIProvider cannot be instantiated directly."""
|
"""Verify that AIProvider cannot be instantiated directly."""
|
||||||
@@ -100,6 +102,7 @@ class TestAIProviderABC:
|
|||||||
# OpenAIProvider
|
# OpenAIProvider
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.unit
|
@pytest.mark.unit
|
||||||
class TestOpenAIProvider:
|
class TestOpenAIProvider:
|
||||||
"""Tests for OpenAIProvider."""
|
"""Tests for OpenAIProvider."""
|
||||||
@@ -181,6 +184,7 @@ class TestOpenAIProvider:
|
|||||||
# AzureOpenAIProvider
|
# AzureOpenAIProvider
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.unit
|
@pytest.mark.unit
|
||||||
class TestAzureOpenAIProvider:
|
class TestAzureOpenAIProvider:
|
||||||
"""Tests for AzureOpenAIProvider."""
|
"""Tests for AzureOpenAIProvider."""
|
||||||
@@ -222,6 +226,7 @@ class TestAzureOpenAIProvider:
|
|||||||
# AnthropicProvider
|
# AnthropicProvider
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.unit
|
@pytest.mark.unit
|
||||||
class TestAnthropicProvider:
|
class TestAnthropicProvider:
|
||||||
"""Tests for AnthropicProvider."""
|
"""Tests for AnthropicProvider."""
|
||||||
@@ -274,6 +279,7 @@ class TestAnthropicProvider:
|
|||||||
# GeminiProvider
|
# GeminiProvider
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.unit
|
@pytest.mark.unit
|
||||||
class TestGeminiProvider:
|
class TestGeminiProvider:
|
||||||
"""Tests for GeminiProvider."""
|
"""Tests for GeminiProvider."""
|
||||||
@@ -312,6 +318,7 @@ class TestGeminiProvider:
|
|||||||
# OllamaProvider
|
# OllamaProvider
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.unit
|
@pytest.mark.unit
|
||||||
class TestOllamaProvider:
|
class TestOllamaProvider:
|
||||||
"""Tests for OllamaProvider."""
|
"""Tests for OllamaProvider."""
|
||||||
@@ -361,6 +368,7 @@ class TestOllamaProvider:
|
|||||||
# OpenRouterProvider
|
# OpenRouterProvider
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.unit
|
@pytest.mark.unit
|
||||||
class TestOpenRouterProvider:
|
class TestOpenRouterProvider:
|
||||||
"""Tests for OpenRouterProvider."""
|
"""Tests for OpenRouterProvider."""
|
||||||
@@ -394,6 +402,7 @@ class TestOpenRouterProvider:
|
|||||||
# PortkeyProvider
|
# PortkeyProvider
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.unit
|
@pytest.mark.unit
|
||||||
class TestPortkeyProvider:
|
class TestPortkeyProvider:
|
||||||
"""Tests for PortkeyProvider."""
|
"""Tests for PortkeyProvider."""
|
||||||
@@ -485,6 +494,7 @@ class TestPortkeyProvider:
|
|||||||
# LiteLLMProvider
|
# LiteLLMProvider
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.unit
|
@pytest.mark.unit
|
||||||
class TestLiteLLMProvider:
|
class TestLiteLLMProvider:
|
||||||
"""Tests for LiteLLMProvider."""
|
"""Tests for LiteLLMProvider."""
|
||||||
@@ -566,6 +576,7 @@ class TestLiteLLMProvider:
|
|||||||
# get_ai_provider factory function
|
# get_ai_provider factory function
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.unit
|
@pytest.mark.unit
|
||||||
class TestGetAIProvider:
|
class TestGetAIProvider:
|
||||||
"""Tests for the get_ai_provider factory function."""
|
"""Tests for the get_ai_provider factory function."""
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ from app.tasks.check_credentials import (
|
|||||||
get_failure_state,
|
get_failure_state,
|
||||||
save_failure_state,
|
save_failure_state,
|
||||||
sync_test_azure_connection,
|
sync_test_azure_connection,
|
||||||
sync_test_ai_provider_connection,
|
|
||||||
sync_test_openai_connection,
|
sync_test_openai_connection,
|
||||||
unwrap_decorated_function,
|
unwrap_decorated_function,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user