示例#1
0
 def test_node_degree_xy_directed(self):
     xy=sorted(mixing.node_degree_xy(self.D))
     xy_result=sorted([(2,1),
                       (2,3),
                       (1,3),
                       (1,3)])
     assert_equal(xy,xy_result)
示例#2
0
 def test_node_degree_xy_undirected(self):
     xy=sorted(mixing.node_degree_xy(self.P4))
     xy_result=sorted([(1,2),
                       (2,1),
                       (2,2),
                       (2,2),
                       (1,2),
                       (2,1)])
     assert_equal(xy,xy_result)
示例#3
0
 def test_node_degree_xy_multigraph(self):
     xy=sorted(mixing.node_degree_xy(self.M))
     xy_result=sorted([(2,3),
                       (2,3),
                       (3,2),
                       (3,2),
                       (2,3),
                       (3,2),
                       (1,2),
                       (2,1)])
     assert_equal(xy,xy_result)
示例#4
0
 def test_node_degree_xy_selfloop(self):
     xy=sorted(mixing.node_degree_xy(self.S))
     xy_result=sorted([(2,2),
                       (2,2)])
     assert_equal(xy,xy_result)