-
Notifications
You must be signed in to change notification settings - Fork 901
tests: Add unit tests for mcp_tool #663
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
content=types.Content(role='user', parts=parts) | ||
) | ||
yield llm_response | ||
user_text = message.server_content.input_transcription.text |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you run pyink --config pyproject.toml ? usually we don't need to reformat the codes as they are already formatted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, this file is unrelated to the PR. let's keep the PR clean
@@ -102,7 +102,7 @@ def get_session( | |||
break | |||
i -= 1 | |||
if i >= 0: | |||
copied_session.events = copied_session.events[i + 1:] | |||
copied_session.events = copied_session.events[i + 1 :] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
@@ -137,5 +137,6 @@ async def get_tools( | |||
mcp_session_manager=self._session_manager, | |||
) | |||
for tool in tools_response.tools | |||
if self._is_selected(tool, readonly_context) | |||
if self.tool_predicate is None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this change is by mistake ?
@@ -93,6 +93,8 @@ def test_cli_create_cmd_invokes_run_cmd( | |||
|
|||
|
|||
# cli run | |||
import platform |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by mistake?
@@ -0,0 +1,106 @@ | |||
from typing import Any, Dict |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put this file in mcp_tool folder
@@ -0,0 +1,58 @@ | |||
import pytest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put this file under mcp_tool folder
#542
Hi @hangfei,
This commit adds tests for:
mcp_tool.py
mcp_toolset.py
conversion_utils.py
Current test coverage: