Pārlūkot izejas kodu

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 pirms 3 gadiem
committed by GitHub
vecāks
revīzija
e43c860732
Šim parakstam datu bāzē netika atrasta zināma atslēga GPG atslēgas ID: 4AEE18F83AFDEB23
21 mainītis faili ar 14 papildinājumiem un 9 dzēšanām
  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 Parādīt failu

@@ -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 Parādīt failu


resources/openstack/adjacentenablers/containerservices/kuryr.png → resources/openstack/containerservices/kuryr.png Parādīt failu


resources/openstack/lifecyclemanagement/deployment/ansible.png → resources/openstack/deployment/ansible.png Parādīt failu


resources/openstack/lifecyclemanagement/deployment/charms.png → resources/openstack/deployment/charms.png Parādīt failu


resources/openstack/lifecyclemanagement/deployment/chef.png → resources/openstack/deployment/chef.png Parādīt failu


resources/openstack/lifecyclemanagement/deployment/helm.png → resources/openstack/deployment/helm.png Parādīt failu


resources/openstack/lifecyclemanagement/deployment/kolla.png → resources/openstack/deployment/kolla.png Parādīt failu


resources/openstack/lifecyclemanagement/deployment/tripleo.png → resources/openstack/deployment/tripleo.png Parādīt failu


resources/openstack/operations/monitoring/monasca.png → resources/openstack/monitoring/monasca.png Parādīt failu


resources/openstack/operations/monitoring/telemetry.png → resources/openstack/monitoring/telemetry.png Parādīt failu


resources/openstack/operations/multiregion/tricircle.png → resources/openstack/multiregion/tricircle.png Parādīt failu


resources/openstack/adjacentenablers/nfv/tacker.png → resources/openstack/nfv/tacker.png Parādīt failu


resources/openstack/operations/optimization/congress.png → resources/openstack/optimization/congress.png Parādīt failu


resources/openstack/operations/optimization/rally.png → resources/openstack/optimization/rally.png Parādīt failu


resources/openstack/operations/optimization/vitrage.png → resources/openstack/optimization/vitrage.png Parādīt failu


resources/openstack/operations/optimization/watcher.png → resources/openstack/optimization/watcher.png Parādīt failu


resources/openstack/lifecyclemanagement/packaging/loci.png → resources/openstack/packaging/loci.png Parādīt failu


resources/openstack/lifecyclemanagement/packaging/puppet.png → resources/openstack/packaging/puppet.png Parādīt failu


resources/openstack/lifecyclemanagement/packaging/rpm.png → resources/openstack/packaging/rpm.png Parādīt failu


+ 14
- 0
tests/test_diagram.py Parādīt failu

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

Notiek ielāde…
Atcelt
Saglabāt