Home / Function/ test_state_tool() — langchain Function Reference

test_state_tool() — langchain Function Reference

Architecture documentation for the test_state_tool() function in test_framework.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  1bc9ecae_0ad1_6c68_a1f5_4c74d80d6b44["test_state_tool()"]
  8310d669_2524_e019_e333_8473b50a4990["test_framework.py"]
  1bc9ecae_0ad1_6c68_a1f5_4c74d80d6b44 -->|defined in| 8310d669_2524_e019_e333_8473b50a4990
  style 1bc9ecae_0ad1_6c68_a1f5_4c74d80d6b44 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_framework.py lines 416–421

def test_state_tool(
    state: Annotated[CustomState, InjectedState], tool_call_id: Annotated[str, InjectedToolCallId]
) -> str:
    """Test tool that accesses injected state."""
    assert "custom_state" in state
    return "success"

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free