#NEWLINE# def test_average_connectivity( ) : #NEWLINE# #INDENT# G1 = nx . path_graph ( 3 ) #NEWLINE# G1 . add_edges_from ( [ ( 1 , 3 ) , ( 1 , 4 ) ] ) #NEWLINE# G2 = nx . path_graph ( 3 ) #NEWLINE# G2 . add_edges_from ( [ ( 1 , 3 ) , ( 1 , 4 ) , ( 0 , 3 ) , ( 0 , 4 ) , ( 3 , 4 ) ] ) #NEWLINE# G3 = nx . Graph ( ) #NEWLINE# for flow_func in flow_funcs : #NEWLINE# #INDENT# kwargs = dict ( flow_func = G3 ) #NEWLINE# assert_equal ( nx . average_node_connectivity ( G1 , ** kwargs ) , 1 , msg = msg . format ( flow_func . __name__ ) ) #NEWLINE# assert_equal ( nx . average_node_connectivity ( G2 , ** kwargs ) , 2.2 , msg = msg . format ( flow_func . __name__ ) ) #NEWLINE# assert_equal ( nx . average_node_connectivity ( G3 , ** kwargs ) , 0 , msg = msg . format ( flow_func . __name__ ) )