def test_extract_cluster_level_topology(self): t = algorithms.IcnTopology(fnss.line_topology(6)) t.graph['icr_candidates'] = set(t.nodes()) clusters = [{0, 1}, {2, 3}, {4, 5}] algorithms.deploy_clusters(t, clusters) ct = algorithms.extract_cluster_level_topology(t) assert len(clusters) == len(ct)
def test_extract_cluster_level_topology(self): t = algorithms.IcnTopology(fnss.line_topology(6)) t.graph['icr_candidates'] = set(t.nodes()) clusters = [set([0, 1]), set([2, 3]), set([4, 5])] algorithms.deploy_clusters(t, clusters) ct = algorithms.extract_cluster_level_topology(t) self.assertEqual(len(clusters), len(ct))
def test_extract_cluster_level_topology(self): t = algorithms.IcnTopology(fnss.line_topology(6)) t.graph['icr_candidates'] = set(t.nodes()) clusters = [set([0, 1]), set([2, 3]), set([4, 5])] algorithms.deploy_clusters(t, clusters) ct = algorithms.extract_cluster_level_topology(t) self.assertEqual(len(clusters), len(ct))
def test_extract_cluster_level_topology_1_cluster(self): t = algorithms.IcnTopology(fnss.line_topology(3)) t.graph['icr_candidates'] = set(t.nodes()) clusters = [t.graph['icr_candidates']] algorithms.deploy_clusters(t, clusters) ct = algorithms.extract_cluster_level_topology(t) assert 1 == len(clusters) assert 1 == ct.number_of_nodes()
def test_extract_cluster_level_topology_1_cluster(self): t = algorithms.IcnTopology(fnss.line_topology(3)) t.graph['icr_candidates'] = set(t.nodes()) clusters = [t.graph['icr_candidates']] algorithms.deploy_clusters(t, clusters) ct = algorithms.extract_cluster_level_topology(t) self.assertEqual(1, len(clusters)) self.assertEqual(1, ct.number_of_nodes())