#NEWLINE# def test_edges_nbunch( self ) : #NEWLINE# #INDENT# G = self . G ( ) #NEWLINE# G . add_edges_from ( [ ( 'A' , 'B' ) , ( 'A' , 'C' ) , ( 'B' , 'D' ) , ( 'C' , 'B' ) , ( 'C' , 'D' ) ] ) #NEWLINE# assert_raises ( nx . NetworkXError , G . edges , 6 ) #NEWLINE# assert_equals ( G . edges ( 'Z' ) , [ ] ) #NEWLINE# assert_equals ( G . edges ( [ ] ) , [ ] ) #NEWLINE# if G . is_directed ( ) : #NEWLINE# #INDENT# elist = [ ( 'A' , 'B' ) , ( 'A' , 'C' ) , ( 'B' , 'D' ) ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# elist = [ ( 'A' , 'B' ) , ( 'A' , 'C' ) , ( 'B' , 'C' ) , ( 'B' , 'D' ) ] #NEWLINE# #UNINDENT# assert_edges_equal ( G . edges ( [ 'A' , 'B' ] ) , elist ) #NEWLINE# assert_edges_equal ( G . edges ( set ( [ 'A' , 'B' ] ) ) , elist ) #NEWLINE# G1 = self . G ( ) #NEWLINE# G1 . add_nodes_from ( 'AB' ) #NEWLINE# assert_edges_equal ( G . edges ( G1 ) , elist ) #NEWLINE# ndict = { #NEWLINE# #INDENT# 'A' : 'thing1' , #NEWLINE# 'B' : 'thing2' , #NEWLINE# #UNINDENT# } #NEWLINE# assert_edges_equal ( G . edges ( ndict ) , elist ) #NEWLINE# assert_edges_equal ( G . edges ( 'A' ) , [ ( 'A' , 'B' ) , ( 'A' , 'C' ) ] ) #NEWLINE# assert_nodes_equal ( sorted ( G ) , [ 'A' , 'B' , 'C' , 'D' ] )