Пример #1
0
 def test_RecipeTaskPreProcess(self):
     """ Test RecipeTaskPreProcess event class """
     callback = lambda a: 2 * a
     tasklist = [("foobar", callback)]
     event = bb.event.RecipeTaskPreProcess(callback, tasklist)
     self.assertEqual(event.fn(1), callback(1))
     self.assertEqual(event.tasklist, tasklist)
     self.assertEqual(event.pid, EventClassesTest._worker_pid)
Пример #2
0
 def test_RecipeTaskPreProcess(self):
     """ Test RecipeTaskPreProcess event class """
     callback = lambda a: 2 * a
     tasklist = [("foobar", callback)]
     event = bb.event.RecipeTaskPreProcess(callback, tasklist)
     self.assertEqual(event.fn(1), callback(1))
     self.assertEqual(event.tasklist, tasklist)
     self.assertEqual(event.pid, EventClassesTest._worker_pid)
Пример #3
0
 def test_RecipeParsed(self):
     """ Test RecipeParsed event base class """
     callback = lambda a: 2 * a
     event = bb.event.RecipeParsed(callback)
     self.assertEqual(event.fn(1), callback(1))
     self.assertEqual(event.pid, EventClassesTest._worker_pid)
Пример #4
0
 def test_RecipePreFinalise(self):
     """ Test RecipePreFinalise event class """
     callback = lambda a: 2 * a
     event = bb.event.RecipePreFinalise(callback)
     self.assertEqual(event.fn(1), callback(1))
     self.assertEqual(event.pid, EventClassesTest._worker_pid)
Пример #5
0
 def test_RecipeParsed(self):
     """ Test RecipeParsed event base class """
     callback = lambda a: 2 * a
     event = bb.event.RecipeParsed(callback)
     self.assertEqual(event.fn(1), callback(1))
     self.assertEqual(event.pid, EventClassesTest._worker_pid)
Пример #6
0
 def test_RecipePreFinalise(self):
     """ Test RecipePreFinalise event class """
     callback = lambda a: 2 * a
     event = bb.event.RecipePreFinalise(callback)
     self.assertEqual(event.fn(1), callback(1))
     self.assertEqual(event.pid, EventClassesTest._worker_pid)