diff --git a/packages/toolbox-core/tests/test_e2e.py b/packages/toolbox-core/tests/test_e2e.py index 0b926e178..72a351531 100644 --- a/packages/toolbox-core/tests/test_e2e.py +++ b/packages/toolbox-core/tests/test_e2e.py @@ -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 diff --git a/packages/toolbox-core/tests/test_e2e_mcp.py b/packages/toolbox-core/tests/test_e2e_mcp.py index 6acaeaded..3be9ee63b 100644 --- a/packages/toolbox-core/tests/test_e2e_mcp.py +++ b/packages/toolbox-core/tests/test_e2e_mcp.py @@ -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 diff --git a/packages/toolbox-core/tests/test_sync_e2e.py b/packages/toolbox-core/tests/test_sync_e2e.py index a306cedc2..ba4227672 100644 --- a/packages/toolbox-core/tests/test_sync_e2e.py +++ b/packages/toolbox-core/tests/test_sync_e2e.py @@ -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"}})