def testSimpleGrps(self): "simple tasks in groups" sched = Sched() tasks = [] for i in xrange(10): t = TrivialTask() tasks.append(t) grp = sched.obtainGroup(mkGrpName(i%2), 2) sched.addTask(t.run, grp) sched.run() for t in tasks: self.assertTrue(t.ran)
def testSimple(self): "simple scheduling and running of tasks" sched = Sched() grp = sched.obtainLocalGroup() tasks = [] for i in xrange(5): t = TrivialTask() tasks.append(t) sched.addTask(t.run, grp) sched.run() for t in tasks: self.assertTrue(t.ran)
def testMoveGrps(self): "tasks moving between groups" sched = Sched() tasks = [] for i in xrange(10): t = MoveGrpTask(mkGrpName(i+1)) tasks.append(t) grp = sched.obtainGroup(mkGrpName(i)) sched.addTask(t.run, grp) sched.run() for t in tasks: self.assertTrue(t.ran) self.assertTrue(t.moved)