class_docstr: Unit tests for the chain decomposition function.
docstr: Test for a graph with multiple connected components.
code: def test_disconnected_graph(self):
      """Test for a graph with multiple connected components."""
      G = nx.barbell_graph(3, 0)
      H = nx.barbell_graph(3, 0)
      mapping = dict(zip(range(6), "abcdef"))
      nx.relabel_nodes(H, mapping, copy=False)
      G = nx.union(G, H)
      chains = list(nx.chain_decomposition(G))
      expected = [
          [(0, 1), (1, 2), (2, 0)],
          [(3, 4), (4, 5), (5, 3)],
          [("a", "b"), ("b", "c"), ("c", "a")],
          [("d", "e"), ("e", "f"), ("f", "d")],
      ]
      assert len(chains) == len(expected)
      for chain in chains:
          self.assertContainsChain(chain, expected)
  
file_path: networkx/networkx/algorithms/tests/test_chains.py
imports: from itertools import cycle, islice
  import pytest
  import networkx
label_desc: Use image node_id 4 for calling the TestChainDecomposition obj's underlying member method code with example usage: obj.test_disconnected_graph() without return types