Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions packages/toolbox-core/tests/test_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,3 +462,41 @@ async def test_run_tool_with_wrong_map_value_type(self, toolbox: ToolboxClient):
execution_context={"env": "staging"},
user_scores={"user4": "not-an-integer"},
)

@pytest.mark.asyncio
@pytest.mark.usefixtures("toolbox_server")
class TestComplexParamsNativeE2E:
"""Tests all 4 tools using the Native Async protocol."""

async def test_process_list_array(self, toolbox: ToolboxClient):
tool = await toolbox.load_tool("process-list")
response = await tool(
email="twishabansal@google.com",
tags=["urgent", "row1", "verified"]
)
assert "twishabansal" in response

async def test_handle_nested_config_map(self, toolbox: ToolboxClient):
tool = await toolbox.load_tool("handle-nested-config")
response = await tool(
filter={"status": "active"},
metadata={"source": "e2e-test", "row_ref": "row2"}
)
assert "active" in response

async def test_manage_data_batches_mixed(self, toolbox: ToolboxClient):
tool = await toolbox.load_tool("manage-data-batches")
response = await tool(
email="twishabansal@google.com",
batches={"primary": [1, 2], "secondary": [3]}
)
assert "primary" in response

async def test_lookup_by_profile_deep(self, toolbox: ToolboxClient):
tool = await toolbox.load_tool("lookup-by-profile")
profile_data = {
"identity": {"email": "twishabansal@google.com"},
"schedule": {"cron": "0 9 * * 1", "timezone": "PST"}
}
response = await tool(profile=profile_data)
assert "twishabansal" in response
38 changes: 38 additions & 0 deletions packages/toolbox-core/tests/test_e2e_mcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,3 +446,41 @@ async def test_run_tool_with_wrong_map_value_type(self, toolbox: ToolboxClient):
execution_context={"env": "staging"},
user_scores={"user4": "not-an-integer"},
)

@pytest.mark.asyncio
@pytest.mark.usefixtures("toolbox_server")
class TestComplexParamsNativeE2E:
"""Tests all 4 tools using the Native Async protocol."""

async def test_process_list_array(self, toolbox: ToolboxClient):
tool = await toolbox.load_tool("process-list")
response = await tool(
email="twishabansal@google.com",
tags=["urgent", "row1", "verified"]
)
assert "twishabansal" in response

async def test_handle_nested_config_map(self, toolbox: ToolboxClient):
tool = await toolbox.load_tool("handle-nested-config")
response = await tool(
filter={"status": "active"},
metadata={"source": "e2e-test", "row_ref": "row2"}
)
assert "active" in response

async def test_manage_data_batches_mixed(self, toolbox: ToolboxClient):
tool = await toolbox.load_tool("manage-data-batches")
response = await tool(
email="twishabansal@google.com",
batches={"primary": [1, 2], "secondary": [3]}
)
assert "primary" in response

async def test_lookup_by_profile_deep(self, toolbox: ToolboxClient):
tool = await toolbox.load_tool("lookup-by-profile")
profile_data = {
"identity": {"email": "twishabansal@google.com"},
"schedule": {"cron": "0 9 * * 1", "timezone": "PST"}
}
response = await tool(profile=profile_data)
assert "twishabansal" in response
17 changes: 17 additions & 0 deletions packages/toolbox-core/tests/test_sync_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,20 @@ def test_run_tool_param_auth_no_field(
match="no field named row_data in claims",
):
tool()

@pytest.mark.usefixtures("toolbox_server")
class TestComplexParamsSyncE2E:
"""Verifies all 4 tools using the Synchronous client."""

def test_all_sync_complex_tools(self, toolbox: ToolboxSyncClient):
t1 = toolbox.load_tool("process-list")
assert "twishabansal" in t1(email="twishabansal@google.com", tags=["sync-tag"])

t2 = toolbox.load_tool("handle-nested-config")
assert "sync-meta" in t2(filter={}, metadata={"info": "sync-meta"})

t3 = toolbox.load_tool("manage-data-batches")
assert "sync_batch" in t3(email="twishabansal@google.com", batches={"sync_batch": [5]})

t4 = toolbox.load_tool("lookup-by-profile")
assert "twishabansal" in t4(profile={"identity": {"email": "twishabansal@google.com"}})
Loading