Home / Function/ test_double_nested_subgraph_mermaid() — langchain Function Reference

test_double_nested_subgraph_mermaid() — langchain Function Reference

Architecture documentation for the test_double_nested_subgraph_mermaid() function in test_graph.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  59b68446_5c04_8015_d2ee_01a2842c8314["test_double_nested_subgraph_mermaid()"]
  972d89eb_abd0_b940_67b4_eff75c775ace["test_graph.py"]
  59b68446_5c04_8015_d2ee_01a2842c8314 -->|defined in| 972d89eb_abd0_b940_67b4_eff75c775ace
  style 59b68446_5c04_8015_d2ee_01a2842c8314 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/runnables/test_graph.py lines 324–382

def test_double_nested_subgraph_mermaid(snapshot: SnapshotAssertion) -> None:
    empty_data = BaseModel
    nodes = {
        "__start__": Node(
            id="__start__", name="__start__", data=empty_data, metadata=None
        ),
        "parent_1": Node(
            id="parent_1", name="parent_1", data=empty_data, metadata=None
        ),
        "child:child_1:grandchild_1": Node(
            id="child:child_1:grandchild_1",
            name="grandchild_1",
            data=empty_data,
            metadata=None,
        ),
        "child:child_1:grandchild_2": Node(
            id="child:child_1:grandchild_2",
            name="grandchild_2",
            data=empty_data,
            metadata={"__interrupt": "before"},
        ),
        "child:child_2": Node(
            id="child:child_2", name="child_2", data=empty_data, metadata=None
        ),
        "parent_2": Node(
            id="parent_2", name="parent_2", data=empty_data, metadata=None
        ),
        "__end__": Node(id="__end__", name="__end__", data=empty_data, metadata=None),
    }
    edges = [
        Edge(
            source="child:child_1:grandchild_1",
            target="child:child_1:grandchild_2",
            data=None,
            conditional=False,
        ),
        Edge(
            source="child:child_1:grandchild_2",
            target="child:child_2",
            data=None,
            conditional=False,
        ),
        Edge(source="__start__", target="parent_1", data=None, conditional=False),
        Edge(
            source="child:child_2",
            target="parent_2",
            data=None,
            conditional=False,
        ),
        Edge(
            source="parent_1",
            target="child:child_1:grandchild_1",
            data=None,
            conditional=False,
        ),
        Edge(source="parent_2", target="__end__", data=None, conditional=False),
    ]
    graph = Graph(nodes, edges)
    assert graph.draw_mermaid() == snapshot(name="mermaid")

Subdomains

Frequently Asked Questions

What does test_double_nested_subgraph_mermaid() do?
test_double_nested_subgraph_mermaid() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/runnables/test_graph.py.
Where is test_double_nested_subgraph_mermaid() defined?
test_double_nested_subgraph_mermaid() is defined in libs/core/tests/unit_tests/runnables/test_graph.py at line 324.

Analyze Your Own Codebase

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

Try Supermodel Free