def test_of_three_components(self):
     """
     1->2 3 4
     """
     nodes = self.nodes
     nodes[0].neighbors.append(nodes[1])
     self.assertEqual(wcc.weak_connected_components(nodes), [[1, 2], [3], [4]])
 def test_of_four_components(self):
     """
     1 2 3 4
     """
     nodes = self.nodes
     self.assertEqual(
         wcc.weak_connected_components(nodes),
         [[1], [2], [3], [4]])
 def test_of_one_components(self):
     """
     1->2->3<-4
     """
     nodes = self.nodes
     nodes[0].neighbors.append(nodes[1])
     nodes[1].neighbors.append(nodes[2])
     nodes[3].neighbors.append(nodes[2])
     self.assertEqual(wcc.weak_connected_components(nodes), [[1, 2, 3, 4]])