'Test for a graph with multiple connected components.'

def test_disconnected_graph(self):

    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')]]
    self.assertEqual(len(chains), len(expected))
    for chain in chains:
        self.assertContainsChain(chain, expected)
