From 520137a2a8ec2e80c96df017eed8d3a941feaeba Mon Sep 17 00:00:00 2001 From: mingrammer Date: Sun, 11 Jan 2026 18:53:47 +0900 Subject: [PATCH] test: add tests for curvestyle and theme validation --- tests/test_diagram.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tests/test_diagram.py b/tests/test_diagram.py index 10dc7bd2..75fc02b8 100644 --- a/tests/test_diagram.py +++ b/tests/test_diagram.py @@ -34,15 +34,25 @@ class DiagramTest(unittest.TestCase): Diagram(direction=dir) def test_validate_curvestyle(self): - # Normal directions. - for cvs in ("ortho", "curved", "CURVED"): + # Normal curvestyles. + for cvs in ("ortho", "curved", "spline", "polyline", "CURVED"): Diagram(curvestyle=cvs) - # Invalid directions. + # Invalid curvestyles. for cvs in ("tangent", "unknown"): with self.assertRaises(ValueError): Diagram(curvestyle=cvs) + def test_validate_theme(self): + # Valid themes. + for theme in ("neutral", "pastel", "blues", "greens", "orange"): + Diagram(theme=theme) + + # Invalid themes. + for theme in ("dark", "unknown"): + with self.assertRaises(ValueError): + Diagram(theme=theme) + def test_validate_outformat(self): # Normal output formats. for fmt in ("png", "jpg", "svg", "pdf", "PNG", "dot"):