Home / Function/ test_decorator_with_custom_name() — langchain Function Reference

test_decorator_with_custom_name() — langchain Function Reference

Architecture documentation for the test_decorator_with_custom_name() function in test_wrap_model_call.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  8e1d3002_7b92_7dba_e1fc_1bc30144bd76["test_decorator_with_custom_name()"]
  5a3c6db0_0302_046a_d217_22fb3d4e632e["TestWrapModelCallDecorator"]
  8e1d3002_7b92_7dba_e1fc_1bc30144bd76 -->|defined in| 5a3c6db0_0302_046a_d217_22fb3d4e632e
  style 8e1d3002_7b92_7dba_e1fc_1bc30144bd76 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_wrap_model_call.py lines 1029–1040

    def test_decorator_with_custom_name(self) -> None:
        """Test decorator with custom middleware name."""

        @wrap_model_call(name="CustomMiddleware")
        def my_middleware(
            request: ModelRequest,
            handler: Callable[[ModelRequest], ModelResponse],
        ) -> ModelCallResult:
            return handler(request)

        assert isinstance(my_middleware, AgentMiddleware)
        assert my_middleware.__class__.__name__ == "CustomMiddleware"

Domain

Subdomains

Frequently Asked Questions

What does test_decorator_with_custom_name() do?
test_decorator_with_custom_name() is a function in the langchain codebase, defined in libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_wrap_model_call.py.
Where is test_decorator_with_custom_name() defined?
test_decorator_with_custom_name() is defined in libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_wrap_model_call.py at line 1029.

Analyze Your Own Codebase

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

Try Supermodel Free