test_empty_tools_to_emulate_does_nothing() — langchain Function Reference
Architecture documentation for the test_empty_tools_to_emulate_does_nothing() function in test_tool_emulator.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 984ec8ee_0c34_b8db_c870_d4203ce6e213["test_empty_tools_to_emulate_does_nothing()"] f4edbff2_7ddf_8a09_14d8_c5faf6609d38["TestLLMToolEmulatorBasic"] 984ec8ee_0c34_b8db_c870_d4203ce6e213 -->|defined in| f4edbff2_7ddf_8a09_14d8_c5faf6609d38 style 984ec8ee_0c34_b8db_c870_d4203ce6e213 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_tool_emulator.py lines 218–251
def test_empty_tools_to_emulate_does_nothing(self) -> None:
"""Test that empty tools_to_emulate list means no emulation occurs."""
agent_model = FakeModel(
messages=cycle(
[
AIMessage(
content="",
tool_calls=[
{"name": "calculator", "id": "1", "args": {"expression": "5*5"}}
],
),
AIMessage(content="Done."),
]
)
)
emulator_model = FakeEmulatorModel(responses=["Should not be used"])
emulator = LLMToolEmulator(tools=[], model=emulator_model)
agent = create_agent(
model=agent_model,
tools=[calculator],
middleware=[emulator],
)
result = agent.invoke({"messages": [HumanMessage("Calculate 5*5")]})
# Calculator should execute normally
tool_messages = [
msg for msg in result["messages"] if hasattr(msg, "name") and msg.name == "calculator"
]
assert len(tool_messages) > 0
assert "Result: 25" in tool_messages[0].content
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does test_empty_tools_to_emulate_does_nothing() do?
test_empty_tools_to_emulate_does_nothing() is a function in the langchain codebase, defined in libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_tool_emulator.py.
Where is test_empty_tools_to_emulate_does_nothing() defined?
test_empty_tools_to_emulate_does_nothing() is defined in libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_tool_emulator.py at line 218.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free