Home / Function/ test_tool_node_not_accepted() — langchain Function Reference

test_tool_node_not_accepted() — langchain Function Reference

Architecture documentation for the test_tool_node_not_accepted() function in test_tools.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  0a837927_79f1_19ce_f981_a910815796e4["test_tool_node_not_accepted()"]
  5e05f5a6_3c9a_6b02_08a5_596bf1a6469a["test_tools.py"]
  0a837927_79f1_19ce_f981_a910815796e4 -->|defined in| 5e05f5a6_3c9a_6b02_08a5_596bf1a6469a
  style 0a837927_79f1_19ce_f981_a910815796e4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_tools.py lines 363–378

def test_tool_node_not_accepted() -> None:
    """Test that passing a ToolNode instance to create_agent raises an error."""

    @tool
    def some_tool(value: str) -> str:
        """Some tool."""
        return "result"

    tool_node = ToolNode([some_tool])

    with pytest.raises(TypeError, match="'ToolNode' object is not iterable"):
        create_agent(
            model=FakeToolCallingModel(),
            tools=tool_node,  # type: ignore[arg-type]
            system_prompt="You are a helpful assistant.",
        )

Domain

Subdomains

Frequently Asked Questions

What does test_tool_node_not_accepted() do?
test_tool_node_not_accepted() is a function in the langchain codebase, defined in libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_tools.py.
Where is test_tool_node_not_accepted() defined?
test_tool_node_not_accepted() is defined in libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_tools.py at line 363.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free