当前位置: 首页>>代码示例>>Python>>正文


Python DummyProcessGroup.dispatchers方法代码示例

本文整理汇总了Python中supervisor.tests.base.DummyProcessGroup.dispatchers方法的典型用法代码示例。如果您正苦于以下问题:Python DummyProcessGroup.dispatchers方法的具体用法?Python DummyProcessGroup.dispatchers怎么用?Python DummyProcessGroup.dispatchers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在supervisor.tests.base.DummyProcessGroup的用法示例。


在下文中一共展示了DummyProcessGroup.dispatchers方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_runforever_select_dispatcher_exitnow

# 需要导入模块: from supervisor.tests.base import DummyProcessGroup [as 别名]
# 或者: from supervisor.tests.base.DummyProcessGroup import dispatchers [as 别名]
 def test_runforever_select_dispatcher_exitnow(self):
     options = DummyOptions()
     supervisord = self._makeOne(options)
     pconfig = DummyPConfig(options, 'foo', '/bin/foo',)
     gconfig = DummyPGroupConfig(options, pconfigs=[pconfig])
     pgroup = DummyProcessGroup(gconfig)
     from supervisor.medusa import asyncore_25 as asyncore
     exitnow = DummyDispatcher(readable=True, error=asyncore.ExitNow)
     pgroup.dispatchers = {6:exitnow}
     supervisord.process_groups = {'foo': pgroup}
     options.select_result = [6], [], []
     options.test = True
     self.assertRaises(asyncore.ExitNow, supervisord.runforever)
开发者ID:GulsahKose,项目名称:supervisor,代码行数:15,代码来源:test_supervisord.py

示例2: test_runforever_select_dispatcher_handle_error_via_write

# 需要导入模块: from supervisor.tests.base import DummyProcessGroup [as 别名]
# 或者: from supervisor.tests.base.DummyProcessGroup import dispatchers [as 别名]
 def test_runforever_select_dispatcher_handle_error_via_write(self):
     options = DummyOptions()
     options.poller.result = [], [sys.stdout]
     supervisord = self._makeOne(options)
     pconfig = DummyPConfig(options, 'foo', '/bin/foo', )
     gconfig = DummyPGroupConfig(options, pconfigs=[pconfig])
     pgroup = DummyProcessGroup(gconfig)
     notimpl = DummyDispatcher(readable=True, error=NotImplementedError)
     pgroup.dispatchers = {sys.stdout: notimpl}
     supervisord.process_groups = {'foo': pgroup}
     options.test = True
     supervisord.runforever()
     self.assertEqual(notimpl.error_handled, True)
开发者ID:alexsilva,项目名称:supervisor,代码行数:15,代码来源:test_supervisord.py

示例3: test_runforever_select_dispatchers

# 需要导入模块: from supervisor.tests.base import DummyProcessGroup [as 别名]
# 或者: from supervisor.tests.base.DummyProcessGroup import dispatchers [as 别名]
 def test_runforever_select_dispatchers(self):
     options = DummyOptions()
     supervisord = self._makeOne(options)
     pconfig = DummyPConfig(options, 'foo', '/bin/foo',)
     gconfig = DummyPGroupConfig(options, pconfigs=[pconfig])
     pgroup = DummyProcessGroup(gconfig)
     readable = DummyDispatcher(readable=True)
     writable = DummyDispatcher(writable=True)
     error = DummyDispatcher(writable=True, error=OSError)
     pgroup.dispatchers = {6:readable, 7:writable, 8:error}
     supervisord.process_groups = {'foo': pgroup}
     options.select_result = [6], [7, 8], []
     options.test = True
     supervisord.runforever()
     self.assertEqual(pgroup.transitioned, True)
     self.assertEqual(readable.read_event_handled, True)
     self.assertEqual(writable.write_event_handled, True)
     self.assertEqual(error.error_handled, True)
开发者ID:GulsahKose,项目名称:supervisor,代码行数:20,代码来源:test_supervisord.py


注:本文中的supervisor.tests.base.DummyProcessGroup.dispatchers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。