pull/1260/merge
hhang 4 days ago committed by GitHub
commit cd9e960459
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -196,11 +196,11 @@ class Diagram:
if not self._validate_direction(direction):
raise ValueError(f'"{direction}" is not a valid direction')
self.dot.graph_attr["rankdir"] = direction
self.dot.graph_attr["rankdir"] = direction.upper()
if not self._validate_curvestyle(curvestyle):
raise ValueError(f'"{curvestyle}" is not a valid curvestyle')
self.dot.graph_attr["splines"] = curvestyle
self.dot.graph_attr["splines"] = curvestyle.lower()
if isinstance(outformat, list):
for one_format in outformat:

@ -43,6 +43,11 @@ class DiagramTest(unittest.TestCase):
with self.assertRaises(ValueError):
Diagram(curvestyle=cvs)
def test_case_insensitive_graph_attributes(self):
diagram = Diagram(direction="lr", curvestyle="CURVED")
self.assertEqual(diagram.dot.graph_attr["rankdir"], "LR")
self.assertEqual(diagram.dot.graph_attr["splines"], "curved")
def test_validate_theme(self):
# Valid themes.
for theme in ("neutral", "pastel", "blues", "greens", "orange"):

Loading…
Cancel
Save