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)
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)
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)