|
|
@@ -1,6 +1,7 @@ |
|
|
|
import os |
|
|
|
import shutil |
|
|
|
import unittest |
|
|
|
import pathlib |
|
|
|
|
|
|
|
from diagrams import Cluster, Diagram, Edge, Node |
|
|
|
from diagrams import getcluster, getdiagram, setcluster, setdiagram |
|
|
@@ -283,3 +284,16 @@ class EdgeTest(unittest.TestCase): |
|
|
|
self.assertEqual( |
|
|
|
nodes << Edge(color="green", label="6.3") << Edge(color="pink", label="6.4") << node1, node1 |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
class ResourcesTest(unittest.TestCase): |
|
|
|
def test_folder_depth(self): |
|
|
|
""" |
|
|
|
The code currently only handles resource folders up to a dir depth of 2 |
|
|
|
i.e. resources/<provider>/<type>/<image>, so check that this depth isn't |
|
|
|
exceeded. |
|
|
|
""" |
|
|
|
resources_dir = pathlib.Path(__file__).parent.parent / 'resources' |
|
|
|
max_depth = max(os.path.relpath(d, resources_dir).count(os.sep) + 1 |
|
|
|
for d, _, _ in os.walk(resources_dir)) |
|
|
|
self.assertLessEqual(max_depth, 2) |