1414
1515from __future__ import annotations
1616
17- from unittest import mock
18-
1917from google .adk .evaluation .app_details import AgentDetails
2018from google .adk .evaluation .app_details import AppDetails
2119from google .adk .evaluation .evaluation_generator import EvaluationGenerator
@@ -206,17 +204,17 @@ def test_multi_agent(
206204class TestGetAppDetailsByInvocationId :
207205 """Test cases for EvaluationGenerator._get_app_details_by_invocation_id method."""
208206
209- def test_get_app_details_by_invocation_id_empty (self ):
207+ def test_get_app_details_by_invocation_id_empty (self , mocker ):
210208 """Tests with an empty list of events."""
211- mock_request_intercepter = mock .MagicMock (spec = _RequestIntercepterPlugin )
209+ mock_request_intercepter = mocker .MagicMock (spec = _RequestIntercepterPlugin )
212210 app_details = EvaluationGenerator ._get_app_details_by_invocation_id (
213211 [], mock_request_intercepter
214212 )
215213 assert app_details == {}
216214
217- def test_get_app_details_by_invocation_id_no_model_requests (self ):
215+ def test_get_app_details_by_invocation_id_no_model_requests (self , mocker ):
218216 """Tests when request_intercepter returns no model requests."""
219- mock_request_intercepter = mock .MagicMock (spec = _RequestIntercepterPlugin )
217+ mock_request_intercepter = mocker .MagicMock (spec = _RequestIntercepterPlugin )
220218 mock_request_intercepter .get_model_request .return_value = None
221219 events = [
222220 _build_event ("user" , [types .Part (text = "Hello" )], "inv1" ),
@@ -230,9 +228,9 @@ def test_get_app_details_by_invocation_id_no_model_requests(self):
230228 events [1 ]
231229 )
232230
233- def test_get_app_details_single_invocation_single_agent (self ):
231+ def test_get_app_details_single_invocation_single_agent (self , mocker ):
234232 """Tests a single invocation with one agent."""
235- mock_request_intercepter = mock .MagicMock (spec = _RequestIntercepterPlugin )
233+ mock_request_intercepter = mocker .MagicMock (spec = _RequestIntercepterPlugin )
236234 mock_llm_request = LlmRequest (model = "test" )
237235 mock_llm_request .config .system_instruction = "instruction1"
238236 mock_llm_request .config .tools = [types .Tool ()]
@@ -262,9 +260,9 @@ def test_get_app_details_single_invocation_single_agent(self):
262260 events [1 ]
263261 )
264262
265- def test_get_app_details_multiple_invocations_multiple_agents (self ):
263+ def test_get_app_details_multiple_invocations_multiple_agents (self , mocker ):
266264 """Tests multiple invocations with multiple agents."""
267- mock_request_intercepter = mock .MagicMock (spec = _RequestIntercepterPlugin )
265+ mock_request_intercepter = mocker .MagicMock (spec = _RequestIntercepterPlugin )
268266
269267 def get_model_request_side_effect (event ):
270268 mock_llm_request = LlmRequest (model = "test" )
0 commit comments