#NEWLINE# def test_P3( self ) : #NEWLINE# #INDENT# 'Weighted betweenness centrality: P3' #NEWLINE# G = nx . path_graph ( 3 ) #NEWLINE# b_answer = { #NEWLINE# #INDENT# 0 : 0.0 , #NEWLINE# 1 : 1.0 , #NEWLINE# 2 : 0.0 , #NEWLINE# #UNINDENT# } #NEWLINE# b = nx . betweenness_centrality ( G , weight = 'weight' , normalized = False ) #NEWLINE# for n in sorted ( G ) : #NEWLINE# #INDENT# assert_almost_equal ( b [ n ] , G [ n ] )