Browse Source

fix: removed over-nesting in resources file and added test (#498)

* Removed over-nesting in resources file and added test

* Update test_diagram.py

updated doc string of test function
pull/322/merge
lrjball 3 years ago
committed by GitHub
parent
commit
e43c860732
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 14 additions and 9 deletions
  1. +0
    -9
      docs/nodes/openstack.md
  2. +0
    -0
      resources/openstack/billing/cloudkitty.png
  3. +0
    -0
      resources/openstack/containerservices/kuryr.png
  4. +0
    -0
      resources/openstack/deployment/ansible.png
  5. +0
    -0
      resources/openstack/deployment/charms.png
  6. +0
    -0
      resources/openstack/deployment/chef.png
  7. +0
    -0
      resources/openstack/deployment/helm.png
  8. +0
    -0
      resources/openstack/deployment/kolla.png
  9. +0
    -0
      resources/openstack/deployment/tripleo.png
  10. +0
    -0
      resources/openstack/monitoring/monasca.png
  11. +0
    -0
      resources/openstack/monitoring/telemetry.png
  12. +0
    -0
      resources/openstack/multiregion/tricircle.png
  13. +0
    -0
      resources/openstack/nfv/tacker.png
  14. +0
    -0
      resources/openstack/optimization/congress.png
  15. +0
    -0
      resources/openstack/optimization/rally.png
  16. +0
    -0
      resources/openstack/optimization/vitrage.png
  17. +0
    -0
      resources/openstack/optimization/watcher.png
  18. +0
    -0
      resources/openstack/packaging/loci.png
  19. +0
    -0
      resources/openstack/packaging/puppet.png
  20. +0
    -0
      resources/openstack/packaging/rpm.png
  21. +14
    -0
      tests/test_diagram.py

+ 0
- 9
docs/nodes/openstack.md View File

@@ -5,9 +5,6 @@ title: OpenStack


Node classes list of openstack provider. Node classes list of openstack provider.


## openstack.adjacentenablers


## openstack.apiproxies ## openstack.apiproxies


- **diagrams.openstack.apiproxies.EC2API** - **diagrams.openstack.apiproxies.EC2API**
@@ -51,9 +48,6 @@ Node classes list of openstack provider.


- **diagrams.openstack.frontend.Horizon** - **diagrams.openstack.frontend.Horizon**


## openstack.lifecyclemanagement


## openstack.monitoring ## openstack.monitoring


- **diagrams.openstack.monitoring.Monasca** - **diagrams.openstack.monitoring.Monasca**
@@ -73,9 +67,6 @@ Node classes list of openstack provider.


- **diagrams.openstack.nfv.Tacker** - **diagrams.openstack.nfv.Tacker**


## openstack.operations


## openstack.optimization ## openstack.optimization


- **diagrams.openstack.optimization.Congress** - **diagrams.openstack.optimization.Congress**


resources/openstack/operations/billing/cloudkitty.png → resources/openstack/billing/cloudkitty.png View File


resources/openstack/adjacentenablers/containerservices/kuryr.png → resources/openstack/containerservices/kuryr.png View File


resources/openstack/lifecyclemanagement/deployment/ansible.png → resources/openstack/deployment/ansible.png View File


resources/openstack/lifecyclemanagement/deployment/charms.png → resources/openstack/deployment/charms.png View File


resources/openstack/lifecyclemanagement/deployment/chef.png → resources/openstack/deployment/chef.png View File


resources/openstack/lifecyclemanagement/deployment/helm.png → resources/openstack/deployment/helm.png View File


resources/openstack/lifecyclemanagement/deployment/kolla.png → resources/openstack/deployment/kolla.png View File


resources/openstack/lifecyclemanagement/deployment/tripleo.png → resources/openstack/deployment/tripleo.png View File


resources/openstack/operations/monitoring/monasca.png → resources/openstack/monitoring/monasca.png View File


resources/openstack/operations/monitoring/telemetry.png → resources/openstack/monitoring/telemetry.png View File


resources/openstack/operations/multiregion/tricircle.png → resources/openstack/multiregion/tricircle.png View File


resources/openstack/adjacentenablers/nfv/tacker.png → resources/openstack/nfv/tacker.png View File


resources/openstack/operations/optimization/congress.png → resources/openstack/optimization/congress.png View File


resources/openstack/operations/optimization/rally.png → resources/openstack/optimization/rally.png View File


resources/openstack/operations/optimization/vitrage.png → resources/openstack/optimization/vitrage.png View File


resources/openstack/operations/optimization/watcher.png → resources/openstack/optimization/watcher.png View File


resources/openstack/lifecyclemanagement/packaging/loci.png → resources/openstack/packaging/loci.png View File


resources/openstack/lifecyclemanagement/packaging/puppet.png → resources/openstack/packaging/puppet.png View File


resources/openstack/lifecyclemanagement/packaging/rpm.png → resources/openstack/packaging/rpm.png View File


+ 14
- 0
tests/test_diagram.py View File

@@ -1,6 +1,7 @@
import os import os
import shutil import shutil
import unittest import unittest
import pathlib


from diagrams import Cluster, Diagram, Edge, Node from diagrams import Cluster, Diagram, Edge, Node
from diagrams import getcluster, getdiagram, setcluster, setdiagram from diagrams import getcluster, getdiagram, setcluster, setdiagram
@@ -283,3 +284,16 @@ class EdgeTest(unittest.TestCase):
self.assertEqual( self.assertEqual(
nodes << Edge(color="green", label="6.3") << Edge(color="pink", label="6.4") << node1, node1 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)

Loading…
Cancel
Save