#NEWLINE# def test_gnm( self ) : #NEWLINE# #INDENT# G = gnm_random_graph ( 10 , 3 ) #NEWLINE# assert_equal ( len ( G ) , 10 ) #NEWLINE# assert_equal ( sum ( ( 1 for _ in G . edges ( ) ) ) , 3 ) #NEWLINE# G = gnm_random_graph ( 10 , 3 , seed = 42 ) #NEWLINE# assert_equal ( len ( G ) , 10 ) #NEWLINE# assert_equal ( sum ( ( 1 for _ in G . edges ( ) ) ) , 3 ) #NEWLINE# G = gnm_random_graph ( 10 , 100 ) #NEWLINE# assert_equal ( len ( G ) , 10 ) #NEWLINE# assert_equal ( sum ( ( 1 for _ in G . edges ( ) ) ) , 45 ) #NEWLINE# G = gnm_random_graph ( 10 , 100 , directed = True ) #NEWLINE# assert_equal ( len ( G ) , 10 ) #NEWLINE# assert_equal ( sum ( ( 1 for _ in G . edges ( ) ) ) , 90 ) #NEWLINE# G = gnm_random_graph ( 10 , ( - 1.1 ) ) #NEWLINE# assert_equal ( len ( _ ) , 10 ) #NEWLINE# assert_equal ( sum ( ( 1 for _ in G . edges ( ) ) ) , 0 )