|
|
@ -1,10 +1,11 @@
|
|
|
|
import os
|
|
|
|
import os
|
|
|
|
import unittest
|
|
|
|
import unittest
|
|
|
|
from unittest.mock import mock_open, patch
|
|
|
|
|
|
|
|
from io import StringIO
|
|
|
|
from io import StringIO
|
|
|
|
|
|
|
|
from unittest.mock import mock_open, patch
|
|
|
|
|
|
|
|
|
|
|
|
from diagrams.cli import run
|
|
|
|
from diagrams.cli import run
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CliTest(unittest.TestCase):
|
|
|
|
class CliTest(unittest.TestCase):
|
|
|
|
def setUp(self):
|
|
|
|
def setUp(self):
|
|
|
|
self.test_file = "test_diagram.py"
|
|
|
|
self.test_file = "test_diagram.py"
|
|
|
@ -29,6 +30,7 @@ with Diagram("test_2", show=False, direction="TB"):
|
|
|
|
EC2("worker4"),
|
|
|
|
EC2("worker4"),
|
|
|
|
EC2("työntekijä 4")] >> RDS("events")
|
|
|
|
EC2("työntekijä 4")] >> RDS("events")
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
def tearDown(self):
|
|
|
|
def tearDown(self):
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
os.remove("test.png")
|
|
|
|
os.remove("test.png")
|
|
|
@ -47,7 +49,6 @@ with Diagram("test_2", show=False, direction="TB"):
|
|
|
|
except FileNotFoundError:
|
|
|
|
except FileNotFoundError:
|
|
|
|
pass
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_run_with_multiple_files(self):
|
|
|
|
def test_run_with_multiple_files(self):
|
|
|
|
|
|
|
|
|
|
|
|
multiple_files = ["file1.py", "file2.py"]
|
|
|
|
multiple_files = ["file1.py", "file2.py"]
|
|
|
|