#NEWLINE# def test_weighted_digraph( self ) : #NEWLINE# #INDENT# G = nx . DiGraph ( ) #NEWLINE# nx . add_cycle ( G , [ 0 , 1 , 2 ] , weight = 2 ) #NEWLINE# nx . add_cycle ( G , [ 2 , 1 , 0 ] , weight = 2 ) #NEWLINE# vitality = nx . closeness_vitality ( G , weight = 'weight' ) #NEWLINE# assert_equal ( vitality , { #NEWLINE# #INDENT# 0 : 8 , #NEWLINE# 1 : 8 , #NEWLINE# 2 : 8 , #NEWLINE# #UNINDENT# } )