diff --git a/diagrams/__init__.py b/diagrams/__init__.py index 147cd0a8..873a44dc 100644 --- a/diagrams/__init__.py +++ b/diagrams/__init__.py @@ -191,10 +191,10 @@ class Diagram: def render(self) -> None: if isinstance(self.outformat, list): - for one_format in self.outformat: - self.dot.render(format=one_format, view=self.show, quiet=True) + for one_format in self.outformat: + self.dot.render(format=one_format, view=self.show, quiet=True) else: - self.dot.render(format=self.outformat, view=self.show, quiet=True) + self.dot.render(format=self.outformat, view=self.show, quiet=True) class Cluster: diff --git a/tests/test_diagram.py b/tests/test_diagram.py index 3346c22c..37d0e831 100644 --- a/tests/test_diagram.py +++ b/tests/test_diagram.py @@ -108,16 +108,16 @@ class DiagramTest(unittest.TestCase): self.assertTrue(os.path.exists(f"{self.name}.png")) def test_outformat_list(self): - """Check that outformat render all the files from the list.""" - self.name = 'diagrams_image' - with Diagram(show=False, outformat=["dot", "png"]): - Node("node1") - # both files must exist - self.assertTrue(os.path.exists(f"{self.name}.png")) - self.assertTrue(os.path.exists(f"{self.name}.dot")) - - # clean the dot file as it only generated here - os.remove(self.name + ".dot") + """Check that outformat render all the files from the list.""" + self.name = 'diagrams_image' + with Diagram(show=False, outformat=["dot", "png"]): + Node("node1") + # both files must exist + self.assertTrue(os.path.exists(f"{self.name}.png")) + self.assertTrue(os.path.exists(f"{self.name}.dot")) + + # clean the dot file as it only generated here + os.remove(self.name + ".dot") class ClusterTest(unittest.TestCase):