Exemplo n.º 1
0
 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.failUnless(t.ran)
Exemplo n.º 2
0
 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.failUnless(t.ran)
Exemplo n.º 3
0
 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.failUnless(t.ran)
Exemplo n.º 4
0
 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.failUnless(t.ran)
Exemplo n.º 5
0
 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.failUnless(t.ran)
         self.failUnless(t.moved)
Exemplo n.º 6
0
 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.failUnless(t.ran)
         self.failUnless(t.moved)