@@ -224,15 +224,15 @@ async def test_run_tool_param_auth_no_field(
224
224
225
225
226
226
@pytest .mark .asyncio
227
- @pytest .mark .usefixtures ("optional_param_server " )
227
+ @pytest .mark .usefixtures ("toolbox_server " )
228
228
class TestOptionalParams :
229
229
"""
230
230
End-to-end tests for tools with optional parameters.
231
231
"""
232
232
233
- async def test_tool_signature_is_correct (self , optional_toolbox : ToolboxClient ):
233
+ async def test_tool_signature_is_correct (self , toolbox : ToolboxClient ):
234
234
"""Verify the client correctly constructs the signature for a tool with optional params."""
235
- tool = await optional_toolbox .load_tool ("search-rows" )
235
+ tool = await toolbox .load_tool ("search-rows" )
236
236
sig = signature (tool )
237
237
238
238
assert "query" in sig .parameters
@@ -247,31 +247,31 @@ async def test_tool_signature_is_correct(self, optional_toolbox: ToolboxClient):
247
247
assert sig .parameters ["limit" ].annotation is Optional [int ]
248
248
249
249
async def test_run_tool_with_optional_param_omitted (
250
- self , optional_toolbox : ToolboxClient
250
+ self , toolbox : ToolboxClient
251
251
):
252
252
"""Invoke a tool providing only the required parameter."""
253
- tool = await optional_toolbox .load_tool ("search-rows" )
253
+ tool = await toolbox .load_tool ("search-rows" )
254
254
255
255
response = await tool (query = "test query" )
256
256
assert isinstance (response , str )
257
257
assert 'query="test query"' in response
258
258
assert "limit" not in response
259
259
260
260
async def test_run_tool_with_optional_param_provided (
261
- self , optional_toolbox : ToolboxClient
261
+ self , toolbox : ToolboxClient
262
262
):
263
263
"""Invoke a tool providing both required and optional parameters."""
264
- tool = await optional_toolbox .load_tool ("search-rows" )
264
+ tool = await toolbox .load_tool ("search-rows" )
265
265
266
266
response = await tool (query = "test query" , limit = 10 )
267
267
assert isinstance (response , str )
268
268
assert 'query="test query"' in response
269
269
assert "limit=10" in response
270
270
271
271
async def test_run_tool_with_missing_required_param (
272
- self , optional_toolbox : ToolboxClient
272
+ self , toolbox : ToolboxClient
273
273
):
274
274
"""Invoke a tool without its required parameter."""
275
- tool = await optional_toolbox .load_tool ("search-rows" )
275
+ tool = await toolbox .load_tool ("search-rows" )
276
276
with pytest .raises (TypeError , match = "missing a required argument: 'query'" ):
277
277
await tool (limit = 5 )
0 commit comments