Skip to content

Commit ffcb21f

Browse files
committed
Remove unit tests for OpenAI FileSearchTool parsing
Integration tests will cover this logic automatically as part of the full message history snapshots, per code review feedback.
1 parent 8216f31 commit ffcb21f

File tree

1 file changed

+0
-53
lines changed

1 file changed

+0
-53
lines changed

tests/models/test_openai_responses.py

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -7533,56 +7533,3 @@ async def test_openai_responses_model_file_search_tool_stream(allow_model_reques
75337533
if vector_store is not None:
75347534
await async_client.vector_stores.delete(vector_store.id)
75357535
await async_client.close()
7536-
7537-
7538-
# Unit tests below validate the parsing logic.
7539-
7540-
7541-
def test_map_file_search_tool_call():
7542-
"""Test that _map_file_search_tool_call correctly creates builtin tool parts."""
7543-
from openai.types.responses import ResponseFileSearchToolCall
7544-
7545-
from pydantic_ai.models.openai import _map_file_search_tool_call # type: ignore[reportPrivateUsage]
7546-
7547-
# Create a mock ResponseFileSearchToolCall
7548-
file_search_call = ResponseFileSearchToolCall(
7549-
id='fs_test123',
7550-
type='file_search_call',
7551-
status='completed',
7552-
queries=['test query 1', 'test query 2'],
7553-
results=None,
7554-
)
7555-
7556-
call_part, return_part = _map_file_search_tool_call(file_search_call, 'openai')
7557-
7558-
assert call_part.tool_name == 'file_search'
7559-
assert call_part.args == {'queries': ['test query 1', 'test query 2']}
7560-
assert call_part.tool_call_id == 'fs_test123'
7561-
assert call_part.provider_name == 'openai'
7562-
7563-
assert return_part.tool_name == 'file_search'
7564-
assert return_part.tool_call_id == 'fs_test123'
7565-
assert return_part.provider_name == 'openai'
7566-
assert return_part.content == {'status': 'completed'}
7567-
7568-
7569-
def test_map_file_search_tool_call_queries_structure():
7570-
"""Test that _map_file_search_tool_call correctly structures queries and results."""
7571-
from openai.types.responses import ResponseFileSearchToolCall
7572-
7573-
from pydantic_ai.models.openai import _map_file_search_tool_call # type: ignore[reportPrivateUsage]
7574-
7575-
# Create a mock with empty queries list
7576-
file_search_call = ResponseFileSearchToolCall(
7577-
id='fs_empty',
7578-
type='file_search_call',
7579-
status='in_progress',
7580-
queries=[],
7581-
results=None,
7582-
)
7583-
7584-
call_part, return_part = _map_file_search_tool_call(file_search_call, 'openai')
7585-
7586-
assert call_part.args == {'queries': []}
7587-
assert return_part.content == {'status': 'in_progress'}
7588-
assert call_part.tool_call_id == return_part.tool_call_id

0 commit comments

Comments
 (0)