#NEWLINE# def test_all_pairs_connectivity( self ) : #NEWLINE# #INDENT# G = nx . Graph ( ) #NEWLINE# nodes = [ 0 , 1 , 2 , 3 ] #NEWLINE# nx . add_path ( G , nodes ) #NEWLINE# A = { n : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } for n in G } #NEWLINE# for ( u , v ) in itertools . combinations ( nodes , 2 ) : #NEWLINE# #INDENT# A [ u ] [ v ] = A [ v ] [ u ] = nx . node_connectivity ( G , u , v ) #NEWLINE# #UNINDENT# C = nx . all_pairs_node_connectivity ( G ) #NEWLINE# assert_equal ( sorted ( ( ( k , sorted ( v ) ) for ( k , v ) in A . items ( ) ) ) , sorted ( ( ( k , sorted ( v ) ) for ( k , v ) in C . items ( ) ) ) )