Parcourir la source

Merge 9f73c4e6a1 into 1c380b01b5

pull/1000/merge
Jeongseop Lim il y a 1 jour
committed by GitHub
Parent
révision
5a6e69d632
Aucune clé connue n'a été trouvée dans la base pour cette signature ID de la clé GPG: B5690EEEBB952194
2 fichiers modifiés avec 15 ajouts et 1 suppressions
  1. +13
    -0
      diagrams/c4/__init__.py
  2. +2
    -1
      tests/test_c4.py

+ 13
- 0
diagrams/c4/__init__.py Voir le fichier

@@ -58,6 +58,19 @@ def C4Node(name, technology="", description="", type="Container", **kwargs):
return Node(**node_attributes)


def Component(name, technology="", description="", **kwargs):
container_attributes = {
"name": name,
"technology": technology,
"description": description,
"type": "Component",
"fillcolor": "lightskyblue",
"fontcolor": "black",
}
container_attributes.update(kwargs)
return C4Node(**container_attributes)


def Container(name, technology="", description="", **kwargs):
container_attributes = {
"name": name,


+ 2
- 1
tests/test_c4.py Voir le fichier

@@ -5,7 +5,7 @@ import unittest

from diagrams import Diagram
from diagrams import setcluster, setdiagram
from diagrams.c4 import Person, Container, Database, System, SystemBoundary, Relationship
from diagrams.c4 import Person, Container, Database, Component, System, SystemBoundary, Relationship


class C4Test(unittest.TestCase):
@@ -25,6 +25,7 @@ class C4Test(unittest.TestCase):
person = Person("person", "A person.")
container = Container("container", "Java application", "The application.")
database = Database("database", "Oracle database", "Stores information.")
component = Component("component", "Sign In Controller", "A component.")

def test_external_nodes(self):
with Diagram(name=self.name, show=False):


Chargement…
Annuler
Enregistrer