-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/hyakuhei/fluentm
- Loading branch information
Showing
4 changed files
with
114 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,47 @@ | ||
from fluentm import Actor, Boundary, Process, Data, DataFlow | ||
from fluentm import dfd | ||
from fluentm import dfd, renderDfd | ||
|
||
scenes={ | ||
"Test ABC":[ | ||
DataFlow(Process("A"), Process("B"), "Edge 1"), | ||
DataFlow(Process.get("B"), Process("C"), "Edge 2") | ||
], | ||
"Test ABCInOneBoundary":[ #These aren't using .get, they will replace A, B above... that can't be right... | ||
DataFlow(Process("A").inBoundary("BOUNDARY"), Process("B").inBoundary("BOUNDARY"), "Edge 3") | ||
"Test DEInOneBoundary":[ | ||
DataFlow(Process("D").inBoundary("BOUNDARY"), Process("E").inBoundary("BOUNDARY"), "Edge 3") | ||
|
||
] | ||
} | ||
|
||
# Be careful with these, they have to be tabs, not spaces | ||
expectedResults={ | ||
"Test ABC":"""digraph "Test ABC" { | ||
\tcolor=blue rankdir=LR | ||
\tnode [fontname=Arial fontsize=14] | ||
\tA | ||
\tB | ||
\tC | ||
\tA -> B [label="(1) Edge 1"] | ||
\tB -> C [label="(2) Edge 2"] | ||
"Test ABC":"""digraph "Test ABC" { | ||
color=blue rankdir=LR | ||
node [fontname=Arial fontsize=14] | ||
A | ||
B | ||
C | ||
A -> B [label="(1) Edge 1"] | ||
B -> C [label="(2) Edge 2"] | ||
}""", | ||
"Test ABCInOneBoundary":"""digraph "Test ABCInOneBoundary" { | ||
\tcolor=blue rankdir=LR | ||
\tnode [fontname=Arial fontsize=14] | ||
\tsubgraph cluster_BOUNDARY { | ||
\t\tcolor=red label=BOUNDARY | ||
\t\tA | ||
\t\tB | ||
\t} | ||
\tA -> B [label="(1) Edge 3"] | ||
"Test DEInOneBoundary":"""digraph "Test DEInOneBoundary" { | ||
color=blue rankdir=LR | ||
node [fontname=Arial fontsize=14] | ||
subgraph cluster_BOUNDARY { | ||
graph [color=red fontname=Arial fontsize=12 label=BOUNDARY line=dotted] | ||
D | ||
E | ||
} | ||
D -> E [label="(1) Edge 3"] | ||
}""" | ||
} | ||
|
||
def testABC(): | ||
graph = dfd(scenes, "Test ABC") | ||
renderDfd(graph,"Test ABC", outputDir="testOutput") | ||
assert graph.__str__() == expectedResults['Test ABC'] | ||
|
||
def testABInOneBoundary(): | ||
graph = dfd(scenes, "Test ABCInOneBoundary") | ||
print(graph) | ||
assert graph.__str__() == expectedResults['Test ABCInOneBoundary'] | ||
graph = dfd(scenes, "Test DEInOneBoundary") | ||
renderDfd(graph,"Test DEInOneBoundary", outputDir="testOutput") | ||
assert graph.__str__() == expectedResults['Test DEInOneBoundary'] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters