Home / Function/ test_shell_tool_basic_execution() — langchain Function Reference

test_shell_tool_basic_execution() — langchain Function Reference

Architecture documentation for the test_shell_tool_basic_execution() function in test_shell_tool_integration.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  b1bf8b44_ecaf_51c6_9436_cf7e95327b0f["test_shell_tool_basic_execution()"]
  16cf511f_16f7_4874_8879_68a3622bd4eb["test_shell_tool_integration.py"]
  b1bf8b44_ecaf_51c6_9436_cf7e95327b0f -->|defined in| 16cf511f_16f7_4874_8879_68a3622bd4eb
  354734fe_d7c4_f60e_5bb6_2113b3e8d6ed["_get_model()"]
  b1bf8b44_ecaf_51c6_9436_cf7e95327b0f -->|calls| 354734fe_d7c4_f60e_5bb6_2113b3e8d6ed
  style b1bf8b44_ecaf_51c6_9436_cf7e95327b0f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain_v1/tests/integration_tests/agents/middleware/test_shell_tool_integration.py lines 35–53

def test_shell_tool_basic_execution(tmp_path: Path, provider: str) -> None:
    """Test basic shell command execution across different models."""
    workspace = tmp_path / "workspace"
    agent: CompiledStateGraph[Any, Any, _InputAgentState, Any] = create_agent(
        model=_get_model(provider),
        middleware=[ShellToolMiddleware(workspace_root=workspace)],
    )

    result = agent.invoke(
        {"messages": [HumanMessage("Run the command 'echo hello' and tell me what it outputs")]}
    )

    tool_messages = [msg for msg in result["messages"] if msg.type == "tool"]
    assert len(tool_messages) > 0, "Shell tool should have been called"

    tool_outputs = [msg.content for msg in tool_messages]
    assert any("hello" in output.lower() for output in tool_outputs), (
        "Shell output should contain 'hello'"
    )

Domain

Subdomains

Calls

Frequently Asked Questions

What does test_shell_tool_basic_execution() do?
test_shell_tool_basic_execution() is a function in the langchain codebase, defined in libs/langchain_v1/tests/integration_tests/agents/middleware/test_shell_tool_integration.py.
Where is test_shell_tool_basic_execution() defined?
test_shell_tool_basic_execution() is defined in libs/langchain_v1/tests/integration_tests/agents/middleware/test_shell_tool_integration.py at line 35.
What does test_shell_tool_basic_execution() call?
test_shell_tool_basic_execution() calls 1 function(s): _get_model.

Analyze Your Own Codebase

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

Try Supermodel Free