Skip to content

Commit 9090e1f

Browse files
committed
add test with space in variable name
1 parent 7c3a2ab commit 9090e1f

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/test_model_graph.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,14 @@ def simple_model() -> pm.Model:
536536
return model
537537

538538

539+
@pytest.fixture(scope="module")
540+
def variable_with_space():
541+
with pm.Model() as model:
542+
pm.Normal("plant growth")
543+
544+
return model
545+
546+
539547
def test_unknown_node_type(simple_model):
540548
with pytest.raises(ValueError, match="Node formatters must be of type NodeType."):
541549
model_to_graphviz(simple_model, node_formatters={"Unknown Node Type": "dummy"})
@@ -652,3 +660,17 @@ def test_model_to_mermaid(simple_model):
652660
%% Plates:
653661
""")
654662
assert model_to_mermaid(simple_model) == expected_mermaid_string.strip()
663+
664+
665+
def test_model_to_mermaid_with_variable_with_space(variable_with_space):
666+
expected_mermaid_string = dedent("""
667+
graph TD
668+
%% Nodes:
669+
plant_growth([plant growth ~ Normal])
670+
plant_growth@{ shape: rounded }
671+
672+
%% Edges:
673+
674+
%% Plates:
675+
""")
676+
assert model_to_mermaid(variable_with_space) == expected_mermaid_string.strip()

0 commit comments

Comments
 (0)