def test_algorithms(self): t = algorithms.IcnTopology(fnss.line_topology(6)) t.graph['icr_candidates'] = set(t.nodes()) fnss.set_delays_constant(t, 1, 'ms') fnss.set_delays_constant(t, 3, 'ms', [(1, 2), (3, 4)]) clusters = algorithms.compute_clusters(t, 3) expected_clusters = [set([0, 1]), set([2, 3]), set([4, 5])] self.assertEqual(expected_clusters, clusters)
def test_algorithms(self): t = algorithms.IcnTopology(fnss.line_topology(6)) t.graph['icr_candidates'] = set(t.nodes()) fnss.set_delays_constant(t, 1, 'ms') fnss.set_delays_constant(t, 3, 'ms', [(1, 2), (3, 4)]) clusters = algorithms.compute_clusters(t, 3) expected_clusters = [{0, 1}, {2, 3}, {4, 5}] assert expected_clusters == clusters