class_docstr: Unit tests for the :meth:`DiGraph.edge_subgraph` method.
class_docstr_tok: ["Unit","tests","for","the",":","meth",":","`","DiGraph.edge_subgraph","`","method","."]
code: def setup_method(self):
      # Create a doubly-linked path graph on five nodes.
      G = nx.DiGraph(nx.path_graph(5))
      # Add some node, edge, and graph attributes.
      for i in range(5):
          G.nodes[i]["name"] = f"node{i}"
      G.edges[0, 1]["name"] = "edge01"
      G.edges[3, 4]["name"] = "edge34"
      G.graph["name"] = "graph"
      # Get the subgraph induced by the first and last edges.
      self.G = G
      self.H = G.edge_subgraph([(0, 1), (3, 4)])
  
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 1 for calling the TestEdgeSubgraph obj's underlying member method code with example usage: obj.setup_method() without return types