Skip to content

Commit 56dea10

Browse files
committed
chore: Add toolbox tool unit test cases
1 parent 51f2f04 commit 56dea10

File tree

2 files changed

+32
-4
lines changed

2 files changed

+32
-4
lines changed

packages/toolbox-core/tests/test_client.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,7 @@ async def test_load_tool_not_found_in_manifest(aioresponses, test_tool_str):
413413
REQUESTED_TOOL_NAME = "non_existent_tool_xyz"
414414

415415
manifest = ManifestSchema(
416-
serverVersion="0.0.0",
417-
tools={ACTUAL_TOOL_IN_MANIFEST: test_tool_str}
416+
serverVersion="0.0.0", tools={ACTUAL_TOOL_IN_MANIFEST: test_tool_str}
418417
)
419418

420419
aioresponses.get(
@@ -428,5 +427,5 @@ async def test_load_tool_not_found_in_manifest(aioresponses, test_tool_str):
428427
await client.load_tool(REQUESTED_TOOL_NAME)
429428

430429
aioresponses.assert_called_once_with(
431-
f"{TEST_BASE_URL}/api/tool/{REQUESTED_TOOL_NAME}", method='GET'
432-
)
430+
f"{TEST_BASE_URL}/api/tool/{REQUESTED_TOOL_NAME}", method="GET"
431+
)
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
16+
from toolbox_core.tool import create_docstring
17+
18+
19+
def test_create_docstring_no_params():
20+
"""
21+
Tests create_docstring when the params list is empty.
22+
"""
23+
description = "This is a tool description."
24+
params = []
25+
26+
result_docstring = create_docstring(description, params)
27+
28+
assert result_docstring == description
29+
assert "\n\nArgs:" not in result_docstring

0 commit comments

Comments
 (0)