#NEWLINE# def test_info_digraph( self ) : #NEWLINE# #INDENT# G = networkx . DiGraph ( name = 'path_graph(5)' ) #NEWLINE# G . add_path ( [ 0 , 1 , 2 , 3 , 4 ] ) #NEWLINE# info = networkx . info ( G ) #NEWLINE# expected_graph_info = '\n' . join ( [ 'Name: path_graph(5)' , 'Type: DiGraph' , 'Number of nodes: 5' , 'Number of edges: 4' , 'Average in degree:   0.8000' , 'Average out degree:   0.8000' ] ) #NEWLINE# assert_equal ( info , expected_graph_info ) #NEWLINE# info = networkx . info ( expected_node_info , n = 1 ) #NEWLINE# expected_node_info = '\n' . join ( [ 'Node 1 has the following properties:' , 'Degree: 2' , 'Neighbors: 2' ] ) #NEWLINE# assert_equal ( info , expected_node_info ) #NEWLINE# assert_raises ( networkx . NetworkXError , networkx . info , G , n = ( - 1 ) )