Skip to content

Commit fcf7da3

Browse files
committed
remove redundant tests
1 parent 0a79f5a commit fcf7da3

File tree

2 files changed

+0
-80
lines changed

2 files changed

+0
-80
lines changed

packages/toolbox-langchain/tests/test_async_tools.py

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -289,42 +289,6 @@ async def test_toolbox_tool_call_with_auth_tokens(self, auth_toolbox_tool):
289289
headers={"test-auth-source_token": "test-token"},
290290
)
291291

292-
async def test_toolbox_tool_call_with_auth_tokens_insecure(
293-
self, auth_toolbox_tool, auth_tool_schema_dict
294-
):
295-
core_tool_of_auth_tool = auth_toolbox_tool._AsyncToolboxTool__core_tool
296-
mock_session = (
297-
core_tool_of_auth_tool._ToolboxTool__transport._ToolboxTransport__session
298-
)
299-
300-
with pytest.warns(
301-
UserWarning,
302-
match="Sending ID token over HTTP. User data may be exposed. Use HTTPS for secure communication.",
303-
):
304-
insecure_core_tool = self._create_core_tool_from_dict(
305-
session=mock_session,
306-
name="test_tool",
307-
schema_dict=auth_tool_schema_dict,
308-
url="http://test-url",
309-
)
310-
311-
insecure_auth_langchain_tool = AsyncToolboxTool(core_tool=insecure_core_tool)
312-
313-
tool_with_getter = insecure_auth_langchain_tool.add_auth_token_getters(
314-
{"test-auth-source": lambda: "test-token"}
315-
)
316-
result = await tool_with_getter.ainvoke({"param2": 123})
317-
assert result == "test-result"
318-
319-
modified_core_tool = tool_with_getter._AsyncToolboxTool__core_tool
320-
session = modified_core_tool._ToolboxTool__transport._ToolboxTransport__session
321-
assert modified_core_tool._ToolboxTool__transport.base_url == "http://test-url"
322-
session.post.assert_called_once_with(
323-
"http://test-url/api/tool/test_tool/invoke",
324-
json={"param2": 123},
325-
headers={"test-auth-source_token": "test-token"},
326-
)
327-
328292
async def test_toolbox_tool_call_with_invalid_input(self, toolbox_tool):
329293
with pytest.raises(ValidationError) as e:
330294
await toolbox_tool.ainvoke({"param1": 123, "param2": "invalid"})

packages/toolbox-llamaindex/tests/test_async_tools.py

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -306,50 +306,6 @@ async def test_toolbox_tool_call_with_auth_tokens(self, auth_toolbox_tool):
306306
headers={"test-auth-source_token": "test-token"},
307307
)
308308

309-
async def test_toolbox_tool_call_with_auth_tokens_insecure(
310-
self, auth_toolbox_tool, auth_tool_schema_dict
311-
):
312-
core_tool_of_auth_tool = auth_toolbox_tool._AsyncToolboxTool__core_tool
313-
mock_session = (
314-
core_tool_of_auth_tool._ToolboxTool__transport._ToolboxTransport__session
315-
)
316-
317-
with pytest.warns(
318-
UserWarning,
319-
match="Sending ID token over HTTP. User data may be exposed. Use HTTPS for secure communication.",
320-
):
321-
insecure_core_tool = self._create_core_tool_from_dict(
322-
session=mock_session,
323-
name="test_tool",
324-
schema_dict=auth_tool_schema_dict,
325-
url="http://test-url",
326-
)
327-
328-
insecure_auth_llamaindex_tool = AsyncToolboxTool(core_tool=insecure_core_tool)
329-
330-
tool_with_getter = insecure_auth_llamaindex_tool.add_auth_token_getters(
331-
{"test-auth-source": lambda: "test-token"}
332-
)
333-
result = await tool_with_getter.acall(param2=123)
334-
assert result == ToolOutput(
335-
content="test-result",
336-
tool_name="test_tool",
337-
raw_input={"param2": 123},
338-
raw_output="test-result",
339-
)
340-
341-
modified_core_tool = tool_with_getter._AsyncToolboxTool__core_tool
342-
transport = modified_core_tool._ToolboxTool__transport
343-
session = transport._ToolboxTransport__session
344-
345-
assert transport.base_url == "http://test-url"
346-
347-
session.post.assert_called_once_with(
348-
"http://test-url/api/tool/test_tool/invoke",
349-
json={"param2": 123},
350-
headers={"test-auth-source_token": "test-token"},
351-
)
352-
353309
async def test_toolbox_tool_call_with_empty_input(self, toolbox_tool):
354310
with pytest.raises(TypeError) as e:
355311
await toolbox_tool.acall()

0 commit comments

Comments
 (0)