Home / Function/ test_init_validator_receives_correct_class_path() — langchain Function Reference

test_init_validator_receives_correct_class_path() — langchain Function Reference

Architecture documentation for the test_init_validator_receives_correct_class_path() function in test_serializable.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  66364b43_02e3_224d_93e0_7503bad5f9bf["test_init_validator_receives_correct_class_path()"]
  ff9fa6f4_1eec_e12e_ec54_642a0a26cc2d["TestInitValidator"]
  66364b43_02e3_224d_93e0_7503bad5f9bf -->|defined in| ff9fa6f4_1eec_e12e_ec54_642a0a26cc2d
  style 66364b43_02e3_224d_93e0_7503bad5f9bf fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/load/test_serializable.py lines 624–644

    def test_init_validator_receives_correct_class_path(self) -> None:
        """Test that `init_validator` receives the correct class path."""
        msg = AIMessage(content="Hello")
        serialized = dumpd(msg)

        received_class_paths: list[tuple[str, ...]] = []

        def capture_class_path(
            class_path: tuple[str, ...], _kwargs: dict[str, Any]
        ) -> None:
            received_class_paths.append(class_path)

        load(serialized, allowed_objects=[AIMessage], init_validator=capture_class_path)

        assert len(received_class_paths) == 1
        assert received_class_paths[0] == (
            "langchain",
            "schema",
            "messages",
            "AIMessage",
        )

Domain

Subdomains

Frequently Asked Questions

What does test_init_validator_receives_correct_class_path() do?
test_init_validator_receives_correct_class_path() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/load/test_serializable.py.
Where is test_init_validator_receives_correct_class_path() defined?
test_init_validator_receives_correct_class_path() is defined in libs/core/tests/unit_tests/load/test_serializable.py at line 624.

Analyze Your Own Codebase

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

Try Supermodel Free