test_get_or_create_resources_reuses_existing() — langchain Function Reference
Architecture documentation for the test_get_or_create_resources_reuses_existing() function in test_shell_tool.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD ff657f10_5225_97e4_2d13_ef968c775fff["test_get_or_create_resources_reuses_existing()"] f21fd460_1d0c_cb92_cfa1_eae0890e2f58["test_shell_tool.py"] ff657f10_5225_97e4_2d13_ef968c775fff -->|defined in| f21fd460_1d0c_cb92_cfa1_eae0890e2f58 1bc202d6_8b54_02e9_fadd_ff3171c38a75["_empty_state()"] ff657f10_5225_97e4_2d13_ef968c775fff -->|calls| 1bc202d6_8b54_02e9_fadd_ff3171c38a75 style ff657f10_5225_97e4_2d13_ef968c775fff fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_shell_tool.py lines 531–548
def test_get_or_create_resources_reuses_existing(tmp_path: Path) -> None:
"""Test that _get_or_create_resources reuses existing resources."""
workspace = tmp_path / "workspace"
middleware = ShellToolMiddleware(workspace_root=workspace)
state = _empty_state()
# Create resources first time
resources1 = middleware._get_or_create_resources(state)
# Call again - should return the same resources
resources2 = middleware._get_or_create_resources(state)
assert resources1 is resources2
assert resources1.session is resources2.session
# Clean up
resources1.finalizer()
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does test_get_or_create_resources_reuses_existing() do?
test_get_or_create_resources_reuses_existing() 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_get_or_create_resources_reuses_existing() defined?
test_get_or_create_resources_reuses_existing() is defined in libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_shell_tool.py at line 531.
What does test_get_or_create_resources_reuses_existing() call?
test_get_or_create_resources_reuses_existing() 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