Skip to content

Commit 5e55c52

Browse files
committed
Update test_mermaid.py
1 parent c6682fa commit 5e55c52

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/test_mermaid.py

+11
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
""" """
44
# ruff: noqa: T201, T203 `print` found
55

6+
import io
67
import shutil
78
from pathlib import Path
89

@@ -76,6 +77,16 @@ def test_serialize_mermaid_mappers(self):
7677
assert '7-. "1" .->8' in buffer
7778
assert "classDef default fill" in buffer
7879

80+
def test_serialize_mermaid_errors(self):
81+
"""Save/load as object tree with clones."""
82+
tree = fixture.create_typed_tree_simple(clones=True, name="Root")
83+
84+
with pytest.raises(ValueError, match="target must be a Path, str, or"):
85+
tree.to_mermaid_flowchart(15) # type: ignore
86+
87+
with pytest.raises(RuntimeError, match="Need a filepath to"):
88+
tree.to_mermaid_flowchart(io.StringIO("x"), format="png")
89+
7990
def test_serialize_mermaid_typed(self):
8091
"""Save/load as object tree with clones."""
8192
KEEP_FILES = not fixture.is_running_on_ci() and False

0 commit comments

Comments
 (0)