Home / Function/ test_custom_class_with_serializable_containing_secret() — langchain Function Reference

test_custom_class_with_serializable_containing_secret() — langchain Function Reference

Architecture documentation for the test_custom_class_with_serializable_containing_secret() function in test_secret_injection.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  753699f0_8f8e_8166_bad8_6ecfea28d49b["test_custom_class_with_serializable_containing_secret()"]
  ce66dbf1_8b97_04bf_88af_30bbaa94a5c9["TestNonSerializableClassTopLevel"]
  753699f0_8f8e_8166_bad8_6ecfea28d49b -->|defined in| ce66dbf1_8b97_04bf_88af_30bbaa94a5c9
  9667a3de_eb6c_d235_9e9f_0bb0ddcacee3["_assert_no_secret_leak()"]
  753699f0_8f8e_8166_bad8_6ecfea28d49b -->|calls| 9667a3de_eb6c_d235_9e9f_0bb0ddcacee3
  style 753699f0_8f8e_8166_bad8_6ecfea28d49b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/load/test_secret_injection.py lines 217–230

    def test_custom_class_with_serializable_containing_secret(self) -> None:
        """Custom class containing a `Serializable` with secret-like dict."""

        class MyClass:
            def __init__(self, message: Any) -> None:
                self.message = message

        msg = HumanMessage(
            content="Hello",
            additional_kwargs={"data": MALICIOUS_SECRET_DICT},
        )
        payload = MyClass(message=msg)
        # This will serialize as not_implemented, but let's verify no leak
        _assert_no_secret_leak(payload)

Domain

Subdomains

Frequently Asked Questions

What does test_custom_class_with_serializable_containing_secret() do?
test_custom_class_with_serializable_containing_secret() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/load/test_secret_injection.py.
Where is test_custom_class_with_serializable_containing_secret() defined?
test_custom_class_with_serializable_containing_secret() is defined in libs/core/tests/unit_tests/load/test_secret_injection.py at line 217.
What does test_custom_class_with_serializable_containing_secret() call?
test_custom_class_with_serializable_containing_secret() calls 1 function(s): _assert_no_secret_leak.

Analyze Your Own Codebase

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

Try Supermodel Free