def test_run2(self): """ simple case with one single and group context """ d = Disaggregator([c0, g012, g01]) singles, groups = d.run() self.assertTrue(len(singles) == 3) self.assertTrue(self.compare(singles, [[0],[1],[2]])) self.assertTrue(len(groups) == 0)
def test_run3(self): """ simple case with one single and group context """ d = Disaggregator([c0, g345]) singles, groups = d.run() self.assertTrue(len(singles) == 1) self.assertTrue(self.compare(singles, [[0]])) self.assertTrue(len(groups) == 1) self.assertTrue(self.compare(groups, [[3,4,5]]))
def test_run4(self): """ simple case with one single and group context """ d = Disaggregator([g01, g012, g345, g34]) singles, groups = d.run() self.assertTrue(len(singles) == 2) self.assertTrue(self.compare(singles, [[2],[5]])) self.assertTrue(len(groups) == 2) self.assertTrue(self.compare(groups, [[0,1],[3,4]])) d = Disaggregator([c0,c1,c2,c3,c4,g012,g345,g01,g34]) singles, groups = d.run() self.assertTrue(self.compare(singles, [[0],[1],[2],[3],[4],[5]])) self.assertTrue(self.compare(groups, [])) d = Disaggregator([c0,c1,c2,c3,c4,g012,g345,g01,g34, g3478]) singles, groups = d.run() self.assertTrue(self.compare(singles, [[0],[1],[2],[3],[4],[5]])) self.assertTrue(self.compare(groups, [[7,8]]))
def test_run5(self): d = Disaggregator([c0,c1,g01,g012]) singles, groups = d.run() self.assertTrue(self.compare(singles, [[0],[1],[2]])) self.assertTrue(self.compare(groups, []))