def test_task_init(self):
"""
Creating an instance of a patched celery.Task
will yield a patched instance
"""
task = celery.Task()
# Assert instance methods are patched
self.assertIsInstance(task.__init__, wrapt.BoundFunctionWrapper)
self.assertIsInstance(task.apply, wrapt.BoundFunctionWrapper)
self.assertIsInstance(task.apply_async, wrapt.BoundFunctionWrapper)
self.assertIsInstance(task.run, wrapt.BoundFunctionWrapper)
评论列表
文章目录