Home / Function/ test_override_multiple_attributes() — langchain Function Reference

test_override_multiple_attributes() — langchain Function Reference

Architecture documentation for the test_override_multiple_attributes() function in test_overrides.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  1aa16ba4_6b43_66f6_50ac_245652ee6c4a["test_override_multiple_attributes()"]
  fe9405ec_9f76_8e01_a9d8_c9a8313d07fc["TestToolCallRequestOverride"]
  1aa16ba4_6b43_66f6_50ac_245652ee6c4a -->|defined in| fe9405ec_9f76_8e01_a9d8_c9a8313d07fc
  57c861ce_f505_72a1_bf1b_8746decd06c5["test_override_multiple_attributes()"]
  57c861ce_f505_72a1_bf1b_8746decd06c5 -->|calls| 1aa16ba4_6b43_66f6_50ac_245652ee6c4a
  57c861ce_f505_72a1_bf1b_8746decd06c5["test_override_multiple_attributes()"]
  1aa16ba4_6b43_66f6_50ac_245652ee6c4a -->|calls| 57c861ce_f505_72a1_bf1b_8746decd06c5
  style 1aa16ba4_6b43_66f6_50ac_245652ee6c4a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_overrides.py lines 311–353

    def test_override_multiple_attributes(self) -> None:
        """Test overriding multiple attributes at once."""

        @tool
        def test_tool(x: int) -> str:
            """A test tool."""
            return f"Result: {x}"

        @tool
        def another_tool(y: str) -> str:
            """Another test tool."""
            return f"Output: {y}"

        original_call = ToolCall(name="test_tool", args={"x": 5}, id="1", type="tool_call")
        modified_call = ToolCall(
            name="another_tool",
            args={"y": "hello"},
            id="2",
            type="tool_call",
        )

        original_request = ToolCallRequest(
            tool_call=original_call,
            tool=test_tool,
            state={"count": 1},
            runtime=Mock(),
        )

        new_request = original_request.override(
            tool_call=modified_call,
            tool=another_tool,
            state={"count": 2},
        )

        assert new_request.tool_call["name"] == "another_tool"
        assert new_request.tool is not None
        assert new_request.tool.name == "another_tool"
        assert new_request.state == {"count": 2}
        # Original unchanged
        assert original_request.tool_call["name"] == "test_tool"
        assert original_request.tool is not None
        assert original_request.tool.name == "test_tool"
        assert original_request.state == {"count": 1}

Domain

Subdomains

Frequently Asked Questions

What does test_override_multiple_attributes() do?
test_override_multiple_attributes() is a function in the langchain codebase, defined in libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_overrides.py.
Where is test_override_multiple_attributes() defined?
test_override_multiple_attributes() is defined in libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_overrides.py at line 311.
What does test_override_multiple_attributes() call?
test_override_multiple_attributes() calls 1 function(s): test_override_multiple_attributes.
What calls test_override_multiple_attributes()?
test_override_multiple_attributes() is called by 1 function(s): test_override_multiple_attributes.

Analyze Your Own Codebase

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

Try Supermodel Free