chore: fix function tool UT

PiperOrigin-RevId: 764567867
This commit is contained in:
Xiang (Sean) Zhou 2025-05-28 22:29:01 -07:00 committed by Copybara-Service
parent a0714b8afc
commit b92e068155

View File

@ -104,14 +104,16 @@ def test_init():
assert tool.func == function_for_testing_with_no_args
def test_function_returning_none():
@pytest.mark.asyncio
async def test_function_returning_none():
"""Test that the function returns with None actually returning None."""
tool = FunctionTool(function_returning_none)
result = await tool.run_async(args={}, tool_context=MagicMock())
assert result is None
def test_function_returning_empty_dict():
@pytest.mark.asyncio
async def test_function_returning_empty_dict():
"""Test that the function returns with empty dict actually returning empty dict."""
tool = FunctionTool(function_returning_empty_dict)
result = await tool.run_async(args={}, tool_context=MagicMock())