#NEWLINE# def test_ordering( self ) : #NEWLINE# #INDENT# G = nx . DiGraph ( ) #NEWLINE# G . add_edge ( 1 , 2 ) #NEWLINE# G . add_edge ( 2 , 3 ) #NEWLINE# G . add_edge ( 3 , 1 ) #NEWLINE# M = nx . to_scipy_sparse_matrix ( G , nodelist = [ 3 , 2 , 1 ] ) #NEWLINE# np_assert_equal ( M . todense ( ) , np . matrix ( [ [ 0 , 0 , 1 ] , [ 1 , 0 , 0 ] , [ 0 , 1 , 0 ] ] ) )