mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-20 06:35:46 +02:00
23 lines
560 B
Python
23 lines
560 B
Python
from _scripts.notebook_hooks import _apply_conditional_rendering
|
|
|
|
|
|
CONDITIONAL_RENDERING = """
|
|
above
|
|
:::js
|
|
js-content
|
|
:::
|
|
between
|
|
:::python
|
|
python-content
|
|
:::
|
|
below
|
|
"""
|
|
|
|
|
|
def test_conditional_rendering() -> None:
|
|
"""Test logic for conditional rendering of content."""
|
|
output = _apply_conditional_rendering(CONDITIONAL_RENDERING, "js")
|
|
assert output.strip() == "above\njs-content\n\nbetween\n\nbelow"
|
|
output = _apply_conditional_rendering(CONDITIONAL_RENDERING, "python")
|
|
assert output.strip() == "above\n\nbetween\npython-content\n\nbelow"
|