@@ -3290,55 +3290,3 @@ async def test_google_model_file_search_tool_stream(allow_model_requests: None,
32903290 os .unlink (test_file_path )
32913291 if store is not None and store .name is not None :
32923292 await client .aio .file_search_stores .delete (name = store .name , config = {'force' : True })
3293-
3294-
3295- # Unit tests below validate the FileSearchTool parsing logic.
3296-
3297-
3298- def test_map_file_search_grounding_metadata ():
3299- """Test that _map_file_search_grounding_metadata correctly creates builtin tool parts."""
3300- from google .genai .types import GroundingMetadata
3301-
3302- from pydantic_ai .models .google import _map_file_search_grounding_metadata # type: ignore[reportPrivateUsage]
3303-
3304- # Test with retrieval queries
3305- grounding_metadata = GroundingMetadata (
3306- retrieval_queries = ['test query 1' , 'test query 2' ],
3307- grounding_chunks = [],
3308- )
3309-
3310- call_part , return_part = _map_file_search_grounding_metadata (grounding_metadata , 'google-gla' )
3311-
3312- assert call_part is not None
3313- assert return_part is not None
3314- assert call_part .tool_name == 'file_search'
3315- assert call_part .args == {'queries' : ['test query 1' , 'test query 2' ]}
3316- assert call_part .provider_name == 'google-gla'
3317- assert call_part .tool_call_id == return_part .tool_call_id
3318- assert return_part .tool_name == 'file_search'
3319- assert return_part .provider_name == 'google-gla'
3320-
3321-
3322- def test_map_file_search_grounding_metadata_no_queries ():
3323- """Test that _map_file_search_grounding_metadata returns None when no retrieval queries."""
3324- from google .genai .types import GroundingMetadata
3325-
3326- from pydantic_ai .models .google import _map_file_search_grounding_metadata # type: ignore[reportPrivateUsage]
3327-
3328- # Test with no retrieval queries
3329- grounding_metadata = GroundingMetadata (grounding_chunks = [])
3330-
3331- call_part , return_part = _map_file_search_grounding_metadata (grounding_metadata , 'google-gla' )
3332-
3333- assert call_part is None
3334- assert return_part is None
3335-
3336-
3337- def test_map_file_search_grounding_metadata_none ():
3338- """Test that _map_file_search_grounding_metadata handles None metadata."""
3339- from pydantic_ai .models .google import _map_file_search_grounding_metadata # type: ignore[reportPrivateUsage]
3340-
3341- call_part , return_part = _map_file_search_grounding_metadata (None , 'google-gla' )
3342-
3343- assert call_part is None
3344- assert return_part is None
0 commit comments