本文整理汇总了Python中celery.worker.autoreload.Autoreloader._monitor方法的典型用法代码示例。如果您正苦于以下问题:Python Autoreloader._monitor方法的具体用法?Python Autoreloader._monitor怎么用?Python Autoreloader._monitor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类celery.worker.autoreload.Autoreloader
的用法示例。
在下文中一共展示了Autoreloader._monitor方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_stop
# 需要导入模块: from celery.worker.autoreload import Autoreloader [as 别名]
# 或者: from celery.worker.autoreload.Autoreloader import _monitor [as 别名]
def test_stop(self):
x = Autoreloader(Mock(), modules=[__name__])
x._monitor = None
x.stop()
x._monitor = Mock()
x.stop()
x._monitor.stop.assert_called_with()
示例2: test_on_event_loop_close
# 需要导入模块: from celery.worker.autoreload import Autoreloader [as 别名]
# 或者: from celery.worker.autoreload.Autoreloader import _monitor [as 别名]
def test_on_event_loop_close(self):
x = Autoreloader(Mock(), modules=[__name__])
hub = Mock()
x._monitor = Mock()
x.on_event_loop_close(hub)
x._monitor.on_event_loop_close.assert_called_with(hub)
x._monitor = None
x.on_event_loop_close(hub)
示例3: test_on_poll_init
# 需要导入模块: from celery.worker.autoreload import Autoreloader [as 别名]
# 或者: from celery.worker.autoreload.Autoreloader import _monitor [as 别名]
def test_on_poll_init(self):
x = Autoreloader(Mock(), modules=[__name__])
hub = Mock()
x._monitor = None
x.on_init = Mock()
def se(*args, **kwargs):
x._monitor = Mock()
x.on_init.side_effect = se
x.on_poll_init(hub)
x.on_init.assert_called_with()
x._monitor.on_poll_init.assert_called_with(hub)
x._monitor.on_poll_init.reset_mock()
x.on_poll_init(hub)
x._monitor.on_poll_init.assert_called_with(hub)
示例4: test_register_with_event_loop
# 需要导入模块: from celery.worker.autoreload import Autoreloader [as 别名]
# 或者: from celery.worker.autoreload.Autoreloader import _monitor [as 别名]
def test_register_with_event_loop(self):
x = Autoreloader(Mock(), modules=[__name__])
hub = Mock()
x._monitor = None
x.on_init = Mock()
def se(*args, **kwargs):
x._monitor = Mock()
x.on_init.side_effect = se
x.register_with_event_loop(hub)
x.on_init.assert_called_with()
x._monitor.register_with_event_loop.assert_called_with(hub)
x._monitor.register_with_event_loop.reset_mock()
x.register_with_event_loop(hub)
x._monitor.register_with_event_loop.assert_called_with(hub)