Skip to content

Commit 8f16482

Browse files
committed
add default node attribute test for graph
1 parent 7fdfb5f commit 8f16482

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/compas/datastructures/test_graph.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ def test_graph_json_schema(graph):
5252
graph.validate_json()
5353

5454

55+
def test_default_node_attributes():
56+
graph = Graph(name='test', default_node_attributes={'a': 1, 'b': 2})
57+
for node in graph.nodes():
58+
assert graph.node_attribute(node, name='a') == 1
59+
assert graph.node_attribute(node, name='b') == 2
60+
61+
5562
def test_graph_networkx_conversion():
5663
if compas.IPY:
5764
return

0 commit comments

Comments
 (0)