#NEWLINE# def test_successors( self ) : #NEWLINE# #INDENT# G = self . G ( ) #NEWLINE# G . add_nodes_from ( 'GJK' ) #NEWLINE# G . add_edges_from ( [ ( 'A' , 'B' ) , ( 'A' , 'C' ) , ( 'B' , 'D' ) , ( 'B' , 'C' ) , ( 'C' , 'D' ) ] ) #NEWLINE# assert_equal ( sorted ( G . successors ( 'A' ) ) , [ 'B' , 'C' ] ) #NEWLINE# assert_equal ( sorted ( G . successors_iter ( 'A' ) ) , [ 'B' , 'C' ] ) #NEWLINE# assert_equal ( sorted ( G . successors ( 'G' ) ) , [ ] ) #NEWLINE# assert_equal ( sorted ( G . successors ( 'D' ) ) , [ ] ) #NEWLINE# assert_equal ( sorted ( G . successors_iter ( 'G' ) ) , [ ] ) #NEWLINE# assert_raises ( nx . NetworkXError , G . successors , 'j' ) #NEWLINE# assert_raises ( nx . NetworkXError , G . successors_iter , 'j' )