File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
tests/compas/datastructures Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,17 @@ def test_default_node_attributes():
5757 for node in graph .nodes ():
5858 assert graph .node_attribute (node , name = 'a' ) == 1
5959 assert graph .node_attribute (node , name = 'b' ) == 2
60+ graph .node_attribute (node , name = 'a' , value = 3 )
61+ assert graph .node_attribute (node , name = 'a' ) == 3
62+
63+
64+ def test_default_edge_attributes ():
65+ graph = Graph (name = 'test' , default_edge_attributes = {'a' : 1 , 'b' : 2 })
66+ for edge in graph .edges ():
67+ assert graph .edge_attribute (edge , name = 'a' ) == 1
68+ assert graph .edge_attribute (edge , name = 'b' ) == 2
69+ graph .edge_attribute (edge , name = 'a' , value = 3 )
70+ assert graph .edge_attribute (edge , name = 'a' ) == 3
6071
6172
6273def test_graph_networkx_conversion ():
You can’t perform that action at this time.
0 commit comments