Home / Function/ test_empty_output_replaced_with_no_output() — langchain Function Reference

test_empty_output_replaced_with_no_output() — langchain Function Reference

Architecture documentation for the test_empty_output_replaced_with_no_output() function in test_shell_tool.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  2fbbc799_f43c_4946_4613_f376f75d5f3f["test_empty_output_replaced_with_no_output()"]
  f21fd460_1d0c_cb92_cfa1_eae0890e2f58["test_shell_tool.py"]
  2fbbc799_f43c_4946_4613_f376f75d5f3f -->|defined in| f21fd460_1d0c_cb92_cfa1_eae0890e2f58
  1bc202d6_8b54_02e9_fadd_ff3171c38a75["_empty_state()"]
  2fbbc799_f43c_4946_4613_f376f75d5f3f -->|calls| 1bc202d6_8b54_02e9_fadd_ff3171c38a75
  style 2fbbc799_f43c_4946_4613_f376f75d5f3f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_shell_tool.py lines 375–394

def test_empty_output_replaced_with_no_output(tmp_path: Path) -> None:
    """Test that empty command output is replaced with '<no output>'."""
    middleware = ShellToolMiddleware(workspace_root=tmp_path / "workspace")
    runtime = Runtime()
    state = _empty_state()
    try:
        updates = middleware.before_agent(state, runtime)
        if updates:
            state.update(cast("ShellToolState", updates))
        resources = middleware._get_or_create_resources(state)

        result = middleware._run_shell_tool(
            resources,
            {"command": "true"},  # Command that produces no output
            tool_call_id=None,
        )

        assert "<no output>" in result
    finally:
        middleware.after_agent(state, runtime)

Domain

Subdomains

Frequently Asked Questions

What does test_empty_output_replaced_with_no_output() do?
test_empty_output_replaced_with_no_output() is a function in the langchain codebase, defined in libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_shell_tool.py.
Where is test_empty_output_replaced_with_no_output() defined?
test_empty_output_replaced_with_no_output() is defined in libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_shell_tool.py at line 375.
What does test_empty_output_replaced_with_no_output() call?
test_empty_output_replaced_with_no_output() calls 1 function(s): _empty_state.

Analyze Your Own Codebase

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

Try Supermodel Free