-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added fillColor change for any AWS node; added tests
- Loading branch information
Showing
5 changed files
with
104 additions
and
30 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
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
from multicloud_diagrams import MultiCloudDiagrams | ||
|
||
from utils.utils import TestUtilities | ||
|
||
|
||
class TestMultiCloudDiagramsColors(TestUtilities): | ||
|
||
def test_add_default_node_color(self): | ||
# given | ||
mcd = MultiCloudDiagrams() | ||
|
||
# when | ||
sns_arn = 'arn:aws:sns:eu-west-1:123456789012:internal.fifo' | ||
metadata = { | ||
"Owner": 123456789012, | ||
"SubscriptionsConfirmed": 3, | ||
"SubscriptionsPending": 0 | ||
} | ||
mcd.add_vertex(id=sns_arn, node_name='internal.fifo', arn=sns_arn, node_type='sns', metadata=metadata) | ||
|
||
# then | ||
expected = { | ||
'id': 'vertex:sns:arn:aws:sns:eu-west-1:123456789012:internal.fifo', | ||
'value': '<b>Name</b>: internal.fifo<BR><b>ARN</b>: arn:aws:sns:eu-west-1:123456789012:internal.fifo <BR>-----------<BR><b>Owner</b>: 123456789012<BR><b>SubscriptionsConfirmed</b>: 3<BR><b>SubscriptionsPending</b>: 0', | ||
'parent': '1', | ||
'vertex': '1' | ||
} | ||
self.verify_aws_resource(expected, mcd.mxfile, 'internal.fifo', 'sns') | ||
|
||
def test_add_custom_node_color(self): | ||
# given | ||
mcd = MultiCloudDiagrams() | ||
node_color = '#FF0000' | ||
|
||
sns_arn = 'arn:aws:sns:eu-west-1:123456789012:internal.fifo' | ||
metadata = { | ||
"Owner": 123456789012, | ||
"SubscriptionsConfirmed": 3, | ||
"SubscriptionsPending": 0 | ||
} | ||
|
||
# when | ||
mcd.add_vertex(id=sns_arn, node_name='internal.fifo', arn=sns_arn, node_type='sns', metadata=metadata, fill_color=node_color) | ||
|
||
# then | ||
expected = { | ||
'id': 'vertex:sns:arn:aws:sns:eu-west-1:123456789012:internal.fifo', | ||
'value': '<b>Name</b>: internal.fifo<BR><b>ARN</b>: arn:aws:sns:eu-west-1:123456789012:internal.fifo <BR>-----------<BR><b>Owner</b>: 123456789012<BR><b>SubscriptionsConfirmed</b>: 3<BR><b>SubscriptionsPending</b>: 0', | ||
'parent': '1', | ||
'vertex': '1' | ||
} | ||
self.verify_aws_resource(expected, mcd.mxfile, 'internal.fifo', 'sns', fill_color=node_color) |
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