#NEWLINE# def test_P3_unweighted( self ) : #NEWLINE# #INDENT# 'Eigenvector centrality: P3' #NEWLINE# G = nx . path_graph ( 3 ) #NEWLINE# b_answer = { #NEWLINE# #INDENT# 0 : 0.5 , #NEWLINE# 1 : 0.7071 , #NEWLINE# 2 : 0.5 , #NEWLINE# #UNINDENT# } #NEWLINE# b = nx . eigenvector_centrality_numpy ( G , weight = None ) #NEWLINE# for n in sorted ( G ) : #NEWLINE# #INDENT# assert_almost_equal ( b [ n ] , b_answer [ n ] , places = 4 )