Home / Function/ test_decorator_preserves_function_name() — langchain Function Reference

test_decorator_preserves_function_name() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  8cfcc105_930d_448a_2d1a_af0b5b01fa9a["test_decorator_preserves_function_name()"]
  5a3c6db0_0302_046a_d217_22fb3d4e632e["TestWrapModelCallDecorator"]
  8cfcc105_930d_448a_2d1a_af0b5b01fa9a -->|defined in| 5a3c6db0_0302_046a_d217_22fb3d4e632e
  style 8cfcc105_930d_448a_2d1a_af0b5b01fa9a 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 1250–1260

    def test_decorator_preserves_function_name(self) -> None:
        """Test that decorator uses function name for class name."""

        @wrap_model_call
        def my_custom_middleware(
            request: ModelRequest,
            handler: Callable[[ModelRequest], ModelResponse],
        ) -> ModelCallResult:
            return handler(request)

        assert my_custom_middleware.__class__.__name__ == "my_custom_middleware"

Domain

Subdomains

Frequently Asked Questions

What does test_decorator_preserves_function_name() do?
test_decorator_preserves_function_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_preserves_function_name() defined?
test_decorator_preserves_function_name() is defined in libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_wrap_model_call.py at line 1250.

Analyze Your Own Codebase

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

Try Supermodel Free