test_graph_draw_mermaid_png_base_url() — langchain Function Reference
Architecture documentation for the test_graph_draw_mermaid_png_base_url() function in test_graph.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 80ff6a2d_542f_0eba_c51c_cb938bd9b9a9["test_graph_draw_mermaid_png_base_url()"] 972d89eb_abd0_b940_67b4_eff75c775ace["test_graph.py"] 80ff6a2d_542f_0eba_c51c_cb938bd9b9a9 -->|defined in| 972d89eb_abd0_b940_67b4_eff75c775ace style 80ff6a2d_542f_0eba_c51c_cb938bd9b9a9 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/runnables/test_graph.py lines 635–656
def test_graph_draw_mermaid_png_base_url() -> None:
"""Test that Graph.draw_mermaid_png method passes base_url to renderer."""
custom_url = "https://custom.mermaid.com"
mock_response = MagicMock()
mock_response.status_code = 200
mock_response.content = b"fake image data"
with patch("requests.get", return_value=mock_response) as mock_get:
# Create a simple graph
graph = Graph()
start_node = graph.add_node(BaseModel, id="start")
end_node = graph.add_node(BaseModel, id="end")
graph.add_edge(start_node, end_node)
# Call draw_mermaid_png with custom base_url
graph.draw_mermaid_png(draw_method=MermaidDrawMethod.API, base_url=custom_url)
# Verify that the URL was constructed with our custom base URL
assert mock_get.called
args = mock_get.call_args[0]
url = args[0] # First argument to request.get is the URL
assert url.startswith(custom_url)
Domain
Subdomains
Source
Frequently Asked Questions
What does test_graph_draw_mermaid_png_base_url() do?
test_graph_draw_mermaid_png_base_url() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/runnables/test_graph.py.
Where is test_graph_draw_mermaid_png_base_url() defined?
test_graph_draw_mermaid_png_base_url() is defined in libs/core/tests/unit_tests/runnables/test_graph.py at line 635.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free