#NEWLINE# def test_G( self ) : #NEWLINE# #INDENT# 'Weighted betweenness centrality: G' #NEWLINE# G = weighted_G ( ) #NEWLINE# b_answer = { #NEWLINE# #INDENT# 0 : 2.0 , #NEWLINE# 1 : 0.0 , #NEWLINE# 2 : 4.0 , #NEWLINE# 3 : 3.0 , #NEWLINE# 4 : 4.0 , #NEWLINE# 5 : 0.0 , #NEWLINE# #UNINDENT# } #NEWLINE# b = nx . betweenness_centrality ( n , weight = 'weight' , normalized = False ) #NEWLINE# for n in sorted ( G ) : #NEWLINE# #INDENT# assert_almost_equal ( b [ n ] , b_answer [ n ] )