class_docstr: Unit tests for the :meth:`DiGraph.edge_subgraph` method.
class_docstr_tok: ["Unit","tests","for","the",":","meth",":","`","DiGraph.edge_subgraph","`","method","."]
docstr: Test that nodes are added to predecessors and successors.
  
  For more information, see GitHub issue #2370.
docstr_tok: ["Test","that","nodes","are","added","to","predecessors","and","successors",".","For","more","information",",","see","GitHub","issue","#","2370","."]
code: def test_pred_succ(self):
      """Test that nodes are added to predecessors and successors.
  
      For more information, see GitHub issue #2370.
  
      """
      G = nx.DiGraph()
      G.add_edge(0, 1)
      H = G.edge_subgraph([(0, 1)])
      assert list(H.predecessors(0)) == []
      assert list(H.successors(0)) == [1]
      assert list(H.predecessors(1)) == [0]
      assert list(H.successors(1)) == []
  
imports: import pytest
  import networkx
  from networkx.utils import nodes_equal
  from .test_graph import BaseAttrGraphTester, BaseGraphTester
  from .test_graph import TestEdgeSubgraph
  from .test_graph import TestGraph
label_desc: Use image node_id 2 for calling the TestEdgeSubgraph obj's underlying member method code with example usage: obj.test_pred_succ() without return types