Home / Function/ test_document_normal_metadata_allowed() — langchain Function Reference

test_document_normal_metadata_allowed() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  f1727a1d_99ea_e759_616b_774b6e843050["test_document_normal_metadata_allowed()"]
  d90477e3_b806_4058_daf0_8495f08436d6["test_serializable.py"]
  f1727a1d_99ea_e759_616b_774b6e843050 -->|defined in| d90477e3_b806_4058_daf0_8495f08436d6
  style f1727a1d_99ea_e759_616b_774b6e843050 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/load/test_serializable.py lines 385–397

def test_document_normal_metadata_allowed() -> None:
    """Test that `Document` metadata without `'lc'` key works fine."""
    doc = Document(
        page_content="Hello world",
        metadata={"source": "test.txt", "page": 1, "nested": {"key": "value"}},
    )
    serialized = dumpd(doc)

    loaded = load(serialized, allowed_objects=[Document])
    assert loaded.page_content == "Hello world"

    expected = {"source": "test.txt", "page": 1, "nested": {"key": "value"}}
    assert loaded.metadata == expected

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free