|
6 | 6 | import pytest_asyncio |
7 | 7 | from openai import AsyncOpenAI |
8 | 8 | from unittest.mock import Mock, AsyncMock |
9 | | -from typing import AsyncGenerator |
10 | 9 |
|
11 | 10 | sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "src")) |
12 | 11 | from modai.module import ModuleDependencies |
@@ -70,7 +69,7 @@ async def openai_client(request): |
70 | 69 | async def test_llm_generate_response(): |
71 | 70 | """Test LLM generate_response method directly.""" |
72 | 71 | from fastapi import Request |
73 | | - from unittest.mock import Mock, AsyncMock |
| 72 | + from unittest.mock import Mock |
74 | 73 | from modai.modules.model_provider.module import ( |
75 | 74 | ModelProvidersListResponse, |
76 | 75 | ModelProviderResponse, |
@@ -139,7 +138,7 @@ async def test_llm_generate_response(): |
139 | 138 | async def test_llm_generate_response_streaming(): |
140 | 139 | """Test LLM generate_response method directly for streaming.""" |
141 | 140 | from fastapi import Request |
142 | | - from unittest.mock import Mock, AsyncMock |
| 141 | + from unittest.mock import Mock |
143 | 142 | from modai.modules.model_provider.module import ( |
144 | 143 | ModelProvidersListResponse, |
145 | 144 | ModelProviderResponse, |
@@ -210,7 +209,7 @@ async def test_llm_generate_response_streaming(): |
210 | 209 | async def test_chat_responses_api(openai_client: AsyncOpenAI, request): |
211 | 210 | """Test chat responses API.""" |
212 | 211 |
|
213 | | - client_type = request.node.callspec.params["openai_client"] |
| 212 | + request.node.callspec.params["openai_client"] |
214 | 213 | model = "gpt-4o" # No backend_proxy |
215 | 214 |
|
216 | 215 | # Make the request |
@@ -242,7 +241,7 @@ async def test_chat_responses_api(openai_client: AsyncOpenAI, request): |
242 | 241 | async def test_chat_responses_api_streaming(openai_client: AsyncOpenAI, request): |
243 | 242 | """Test streaming chat responses API.""" |
244 | 243 |
|
245 | | - client_type = request.node.callspec.params["openai_client"] |
| 244 | + request.node.callspec.params["openai_client"] |
246 | 245 | model = "gpt-4o" # No backend_proxy |
247 | 246 |
|
248 | 247 | # Make the streaming request |
@@ -351,7 +350,7 @@ async def test_chat_web_module_routing_streaming(): |
351 | 350 | async def test_openai_llm_invalid_model_format(): |
352 | 351 | """Test OpenAILLMChatModule with invalid model format.""" |
353 | 352 | from fastapi import Request |
354 | | - from unittest.mock import Mock, AsyncMock |
| 353 | + from unittest.mock import Mock |
355 | 354 | from modai.modules.model_provider.module import ( |
356 | 355 | ModelProvidersListResponse, |
357 | 356 | ModelProviderResponse, |
@@ -403,7 +402,7 @@ async def test_openai_llm_invalid_model_format(): |
403 | 402 | async def test_openai_llm_provider_not_found(): |
404 | 403 | """Test OpenAILLMChatModule when provider is not found.""" |
405 | 404 | from fastapi import Request |
406 | | - from unittest.mock import Mock, AsyncMock |
| 405 | + from unittest.mock import Mock |
407 | 406 | from modai.modules.model_provider.module import ModelProvidersListResponse |
408 | 407 |
|
409 | 408 | # Mock provider module with no providers |
|
0 commit comments