#NEWLINE# def test_in_degree( self ) : #NEWLINE# #INDENT# G = G . K3 #NEWLINE# assert_equal ( list ( G . in_degree ( ) . values ( ) ) , [ 2 , 2 , 2 ] ) #NEWLINE# assert_equal ( G . in_degree ( ) , { #NEWLINE# #INDENT# 0 : 2 , #NEWLINE# 1 : 2 , #NEWLINE# 2 : 2 , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert_equal ( G . in_degree ( 0 ) , 2 ) #NEWLINE# assert_equal ( G . in_degree ( [ 0 ] ) , { #NEWLINE# #INDENT# 0 : 2 , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert_raises ( ( KeyError , networkx . NetworkXError ) , G . in_degree , ( - 1 ) )