Ver código fonte

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 anos atrás
committed by GitHub
pai
commit
e43c860732
Nenhuma chave conhecida encontrada para esta assinatura no banco de dados ID da chave GPG: 4AEE18F83AFDEB23
21 arquivos alterados com 14 adições e 9 exclusões
  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 Ver arquivo

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

Node classes list of openstack provider.

## openstack.adjacentenablers


## openstack.apiproxies

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

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

## openstack.lifecyclemanagement


## openstack.monitoring

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

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

## openstack.operations


## openstack.optimization

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


resources/openstack/operations/billing/cloudkitty.png → resources/openstack/billing/cloudkitty.png Ver arquivo


resources/openstack/adjacentenablers/containerservices/kuryr.png → resources/openstack/containerservices/kuryr.png Ver arquivo


resources/openstack/lifecyclemanagement/deployment/ansible.png → resources/openstack/deployment/ansible.png Ver arquivo


resources/openstack/lifecyclemanagement/deployment/charms.png → resources/openstack/deployment/charms.png Ver arquivo


resources/openstack/lifecyclemanagement/deployment/chef.png → resources/openstack/deployment/chef.png Ver arquivo


resources/openstack/lifecyclemanagement/deployment/helm.png → resources/openstack/deployment/helm.png Ver arquivo


resources/openstack/lifecyclemanagement/deployment/kolla.png → resources/openstack/deployment/kolla.png Ver arquivo


resources/openstack/lifecyclemanagement/deployment/tripleo.png → resources/openstack/deployment/tripleo.png Ver arquivo


resources/openstack/operations/monitoring/monasca.png → resources/openstack/monitoring/monasca.png Ver arquivo


resources/openstack/operations/monitoring/telemetry.png → resources/openstack/monitoring/telemetry.png Ver arquivo


resources/openstack/operations/multiregion/tricircle.png → resources/openstack/multiregion/tricircle.png Ver arquivo


resources/openstack/adjacentenablers/nfv/tacker.png → resources/openstack/nfv/tacker.png Ver arquivo


resources/openstack/operations/optimization/congress.png → resources/openstack/optimization/congress.png Ver arquivo


resources/openstack/operations/optimization/rally.png → resources/openstack/optimization/rally.png Ver arquivo


resources/openstack/operations/optimization/vitrage.png → resources/openstack/optimization/vitrage.png Ver arquivo


resources/openstack/operations/optimization/watcher.png → resources/openstack/optimization/watcher.png Ver arquivo


resources/openstack/lifecyclemanagement/packaging/loci.png → resources/openstack/packaging/loci.png Ver arquivo


resources/openstack/lifecyclemanagement/packaging/puppet.png → resources/openstack/packaging/puppet.png Ver arquivo


resources/openstack/lifecyclemanagement/packaging/rpm.png → resources/openstack/packaging/rpm.png Ver arquivo


+ 14
- 0
tests/test_diagram.py Ver arquivo

@@ -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)

Carregando…
Cancelar
Salvar