Skip to content

Commit 456cd98

Browse files
committed
test(cli_tools_click): mock get_app_or_root_agent in eval CLI tests
The eval CLI now resolves agents via `get_app_or_root_agent`. Update the shared `mock_get_root_agent` fixture in test_cli_tools_click.py to patch the new resolver and yield `(None, root_agent)`, matching the non-App path the eval-set-id tests exercise.
1 parent ff110b5 commit 456cd98

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

tests/unittests/cli/utils/test_cli_tools_click.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,16 @@ def mock_load_eval_set_from_file():
5959

6060
@pytest.fixture
6161
def mock_get_root_agent():
62-
with mock.patch("google.adk.cli.cli_eval.get_root_agent") as mock_func:
63-
mock_func.return_value = root_agent
62+
"""Patches the agent resolver used by the eval CLI.
63+
64+
`cli_eval` resolves agents via `get_app_or_root_agent` (which returns
65+
`(app, root_agent)`); the eval-set tests don't exercise the App path,
66+
so we yield `(None, root_agent)`.
67+
"""
68+
with mock.patch(
69+
"google.adk.cli.cli_eval.get_app_or_root_agent"
70+
) as mock_func:
71+
mock_func.return_value = (None, root_agent)
6472
yield mock_func
6573

6674

0 commit comments

Comments
 (0)