Home / Function/ test_known_block_types() — langchain Function Reference

test_known_block_types() — langchain Function Reference

Architecture documentation for the test_known_block_types() function in test_messages.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  74defe6b_502e_c563_921b_e897e8b0bbc7["test_known_block_types()"]
  1c821c4f_25a2_9606_a15f_b3df054105ac["test_messages.py"]
  74defe6b_502e_c563_921b_e897e8b0bbc7 -->|defined in| 1c821c4f_25a2_9606_a15f_b3df054105ac
  style 74defe6b_502e_c563_921b_e897e8b0bbc7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/test_messages.py lines 1258–1274

def test_known_block_types() -> None:
    expected = {
        bt
        for bt in get_args(ContentBlock)
        for bt in get_args(bt.__annotations__["type"])
    }
    # Normalize any Literal[...] types in block types to their string values.
    # This ensures all entries are plain strings, not Literal objects.
    expected = {
        t
        if isinstance(t, str)
        else t.__args__[0]
        if hasattr(t, "__args__") and len(t.__args__) == 1
        else t
        for t in expected
    }
    assert expected == KNOWN_BLOCK_TYPES

Domain

Subdomains

Frequently Asked Questions

What does test_known_block_types() do?
test_known_block_types() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/test_messages.py.
Where is test_known_block_types() defined?
test_known_block_types() is defined in libs/core/tests/unit_tests/test_messages.py at line 1258.

Analyze Your Own Codebase

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

Try Supermodel Free