@@ -258,7 +258,7 @@ async def test_run_tool_with_optional_params_omitted(self, toolbox: ToolboxClien
258
258
259
259
response = await tool (
email = "[email protected] " )
260
260
assert isinstance (response , str )
261
- assert 'email= "[email protected] "' in response
261
+ assert '" email": "[email protected] "' in response
262
262
assert "row1" not in response
263
263
assert "row2" in response
264
264
assert "row3" not in response
@@ -272,7 +272,7 @@ async def test_run_tool_with_optional_data_provided(self, toolbox: ToolboxClient
272
272
273
273
response = await tool (
email = "[email protected] " ,
data = "row3" )
274
274
assert isinstance (response , str )
275
- assert 'email= "[email protected] "' in response
275
+ assert '" email": "[email protected] "' in response
276
276
assert "row1" not in response
277
277
assert "row2" not in response
278
278
assert "row3" in response
@@ -286,7 +286,7 @@ async def test_run_tool_with_optional_data_null(self, toolbox: ToolboxClient):
286
286
287
287
response = await tool (
email = "[email protected] " ,
data = None )
288
288
assert isinstance (response , str )
289
- assert 'email= "[email protected] "' in response
289
+ assert '" email": "[email protected] "' in response
290
290
assert "row1" not in response
291
291
assert "row2" in response
292
292
assert "row3" not in response
@@ -300,21 +300,15 @@ async def test_run_tool_with_optional_id_provided(self, toolbox: ToolboxClient):
300
300
301
301
response = await tool (
email = "[email protected] " ,
id = 1 )
302
302
assert isinstance (response , str )
303
- assert 'email="[email protected] "' in response
304
- assert "row1" in response
305
- assert "row2" not in response
306
- assert "row3" not in response
307
- assert "row4" not in response
308
- assert "row5" not in response
309
- assert "row6" not in response
303
+ assert response == "null"
310
304
311
305
async def test_run_tool_with_optional_id_null (self , toolbox : ToolboxClient ):
312
306
"""Invoke a tool providing both required and optional parameters."""
313
307
tool = await toolbox .load_tool ("search-rows" )
314
308
315
309
response = await tool (
email = "[email protected] " ,
id = None )
316
310
assert isinstance (response , str )
317
- assert 'email= "[email protected] "' in response
311
+ assert '" email": "[email protected] "' in response
318
312
assert "row1" not in response
319
313
assert "row2" in response
320
314
assert "row3" not in response
@@ -331,7 +325,7 @@ async def test_run_tool_with_missing_required_param(self, toolbox: ToolboxClient
331
325
async def test_run_tool_with_required_param_null (self , toolbox : ToolboxClient ):
332
326
"""Invoke a tool without its required parameter."""
333
327
tool = await toolbox .load_tool ("search-rows" )
334
- with pytest .raises (TypeError , match = "missing a required argument: 'email'" ):
328
+ with pytest .raises (ValidationError , match = "missing a required argument: 'email'" ):
335
329
await tool (email = None , id = 5 , data = "row5" )
336
330
337
331
async def test_run_tool_with_all_default_params (self , toolbox : ToolboxClient ):
@@ -340,7 +334,7 @@ async def test_run_tool_with_all_default_params(self, toolbox: ToolboxClient):
340
334
341
335
response = await tool (
email = "[email protected] " ,
id = 0 ,
data = "row2" )
342
336
assert isinstance (response , str )
343
- assert 'email= "[email protected] "' in response
337
+ assert '" email": "[email protected] "' in response
344
338
assert "row1" not in response
345
339
assert "row2" in response
346
340
assert "row3" not in response
@@ -354,7 +348,7 @@ async def test_run_tool_with_all_valid_params(self, toolbox: ToolboxClient):
354
348
355
349
response = await tool (
email = "[email protected] " ,
id = 3 ,
data = "row3" )
356
350
assert isinstance (response , str )
357
- assert 'email= "[email protected] "' in response
351
+ assert '" email": "[email protected] "' in response
358
352
assert "row1" not in response
359
353
assert "row2" not in response
360
354
assert "row3" in response
0 commit comments