Skip to content

Commit 21dd41d

Browse files
committed
chore: Add additional integration tests
1 parent 6779eb1 commit 21dd41d

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

packages/toolbox-core/tests/test_e2e.py

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,3 +333,55 @@ async def test_run_tool_with_required_param_null(self, toolbox: ToolboxClient):
333333
tool = await toolbox.load_tool("search-rows")
334334
with pytest.raises(TypeError, match="missing a required argument: 'email'"):
335335
await tool(email=None, id=5, data="row5")
336+
337+
async def test_run_tool_with_all_default_params(self, toolbox: ToolboxClient):
338+
"""Invoke a tool providing all parameters."""
339+
tool = await toolbox.load_tool("search-rows")
340+
341+
response = await tool(email="[email protected]", id=0, data="row2")
342+
assert isinstance(response, str)
343+
assert 'email="[email protected]"' in response
344+
assert "row1" not in response
345+
assert "row2" in response
346+
assert "row3" not in response
347+
assert "row4" not in response
348+
assert "row5" not in response
349+
assert "row6" not in response
350+
351+
async def test_run_tool_with_all_valid_params(self, toolbox: ToolboxClient):
352+
"""Invoke a tool providing all parameters."""
353+
tool = await toolbox.load_tool("search-rows")
354+
355+
response = await tool(email="[email protected]", id=3, data="row3")
356+
assert isinstance(response, str)
357+
assert 'email="[email protected]"' in response
358+
assert "row1" not in response
359+
assert "row2" not in response
360+
assert "row3" in response
361+
assert "row4" not in response
362+
assert "row5" not in response
363+
assert "row6" not in response
364+
365+
async def test_run_tool_with_different_email(self, toolbox: ToolboxClient):
366+
"""Invoke a tool providing all parameters but with a different email."""
367+
tool = await toolbox.load_tool("search-rows")
368+
369+
response = await tool(email="[email protected]", id=3, data="row3")
370+
assert isinstance(response, str)
371+
assert response == 'null'
372+
373+
async def test_run_tool_with_different_data(self, toolbox: ToolboxClient):
374+
"""Invoke a tool providing all parameters but with a different data."""
375+
tool = await toolbox.load_tool("search-rows")
376+
377+
response = await tool(email="[email protected]", id=3, data="row4")
378+
assert isinstance(response, str)
379+
assert response == 'null'
380+
381+
async def test_run_tool_with_different_id(self, toolbox: ToolboxClient):
382+
"""Invoke a tool providing all parameters but with a different data."""
383+
tool = await toolbox.load_tool("search-rows")
384+
385+
response = await tool(email="[email protected]", id=4, data="row3")
386+
assert isinstance(response, str)
387+
assert response == 'null'

0 commit comments

Comments
 (0)