• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python base.DummyOptions类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: test_runforever_calls_tick

 def test_runforever_calls_tick(self):
     options = DummyOptions()
     options.test = True
     supervisord = self._makeOne(options)
     self.assertEqual(len(supervisord.ticks), 0)
     supervisord.runforever()
     self.assertEqual(len(supervisord.ticks), 3)
开发者ID:GulsahKose,项目名称:supervisor,代码行数:7,代码来源:test_supervisord.py


示例2: test_main_first

 def test_main_first(self):
     options = DummyOptions()
     pconfig = DummyPConfig(options, 'foo', 'foo', '/bin/foo')
     gconfigs = [DummyPGroupConfig(options,'foo', pconfigs=[pconfig])]
     options.process_group_configs = gconfigs
     options.test = True
     options.first = True
     supervisord = self._makeOne(options)
     supervisord.main()
     self.assertEqual(options.environment_processed, True)
     self.assertEqual(options.fds_cleaned_up, False)
     self.assertEqual(options.rlimits_set, True)
     self.assertEqual(options.parse_criticals, ['setuid_called'])
     self.assertEqual(options.parse_warnings, [])
     self.assertEqual(options.parse_infos, ['rlimits_set'])
     self.assertEqual(options.autochildlogdir_cleared, True)
     self.assertEqual(len(supervisord.process_groups), 1)
     self.assertEqual(supervisord.process_groups['foo'].config.options,
                      options)
     self.assertEqual(options.environment_processed, True)
     self.assertEqual(options.httpservers_opened, True)
     self.assertEqual(options.signals_set, True)
     self.assertEqual(options.daemonized, True)
     self.assertEqual(options.pidfile_written, True)
     self.assertEqual(options.cleaned_up, True)
开发者ID:shendadi,项目名称:flaskauth,代码行数:25,代码来源:test_supervisord.py


示例3: test_runforever_select_uncaught_exception

 def test_runforever_select_uncaught_exception(self):
     options = DummyOptions()
     import errno
     options.select_error = errno.EBADF
     supervisord = self._makeOne(options)
     import select
     options.test = True
     self.assertRaises(select.error, supervisord.runforever)
开发者ID:GulsahKose,项目名称:supervisor,代码行数:8,代码来源:test_supervisord.py


示例4: test_handle_read_event

 def test_handle_read_event(self):
     options = DummyOptions()
     options.readfd_result = "abc"
     config = DummyPConfig(options, "process1", "/bin/process1", stdout_capture_maxbytes=100)
     process = DummyProcess(config)
     dispatcher = self._makeOne(process)
     self.assertEqual(dispatcher.handle_read_event(), None)
     self.assertEqual(dispatcher.output_buffer, "abc")
开发者ID:whenjonny,项目名称:tupppai-tools,代码行数:8,代码来源:test_dispatchers.py


示例5: test_runforever_select_eintr

 def test_runforever_select_eintr(self):
     options = DummyOptions()
     import errno
     options.select_error = errno.EINTR
     supervisord = self._makeOne(options)
     options.test = True
     supervisord.runforever()
     self.assertEqual(options.logger.data[0], 'EINTR encountered in select')
开发者ID:GulsahKose,项目名称:supervisor,代码行数:8,代码来源:test_supervisord.py


示例6: test_handle_sigint

 def test_handle_sigint(self):
     options = DummyOptions()
     options._signal = signal.SIGINT
     supervisord = self._makeOne(options)
     supervisord.handle_signal()
     self.assertEqual(supervisord.options.mood, SupervisorStates.SHUTDOWN)
     self.assertEqual(options.logger.data[0],
                      'received SIGINT indicating exit request')
开发者ID:alexsilva,项目名称:supervisor,代码行数:8,代码来源:test_supervisord.py


示例7: test_handle_unknown_signal

 def test_handle_unknown_signal(self):
     options = DummyOptions()
     options._signal = signal.SIGUSR1
     supervisord = self._makeOne(options)
     supervisord.handle_signal()
     self.assertEqual(supervisord.options.mood, 1)
     self.assertEqual(options.logger.data[0],
                      'received SIGUSR1 indicating nothing')
开发者ID:GulsahKose,项目名称:supervisor,代码行数:8,代码来源:test_supervisord.py


示例8: test_handle_sigquit

 def test_handle_sigquit(self):
     options = DummyOptions()
     options._signal = signal.SIGQUIT
     supervisord = self._makeOne(options)
     supervisord.handle_signal()
     self.assertEqual(supervisord.options.mood, -1)
     self.assertEqual(options.logger.data[0],
                      'received SIGQUIT indicating exit request')
开发者ID:GulsahKose,项目名称:supervisor,代码行数:8,代码来源:test_supervisord.py


示例9: test_handle_sigabrt

 def test_handle_sigabrt(self):
     options = DummyOptions()
     options._signal = signal.SIGABRT
     supervisord = self._makeOne(options)
     supervisord.handle_signal()
     self.assertEqual(supervisord.options.mood, SupervisorStates.RESTARTING)
     self.assertEqual(options.logger.data[0],
                      'received SIGABRT indicating restart request')
开发者ID:alexsilva,项目名称:supervisor,代码行数:8,代码来源:test_supervisord.py


示例10: test_handle_sighup

 def test_handle_sighup(self):
     options = DummyOptions()
     options._signal = signal.SIGHUP
     supervisord = self._makeOne(options)
     supervisord.handle_signal()
     self.assertEqual(supervisord.options.mood, 0)
     self.assertEqual(options.logger.data[0],
                      'received SIGHUP indicating restart request')
开发者ID:GulsahKose,项目名称:supervisor,代码行数:8,代码来源:test_supervisord.py


示例11: test_handle_read_event_logging_childlog

 def test_handle_read_event_logging_childlog(self):
     options = DummyOptions()
     options.readfd_result = "supercalifragilisticexpialidocious"
     config = DummyPConfig(options, "process1", "/bin/process1", stdout_logfile="/tmp/foo")
     process = DummyProcess(config)
     dispatcher = self._makeOne(process)
     self.assertEqual(dispatcher.handle_read_event(), None)
     self.assertEqual(len(dispatcher.childlog.data), 1)
     self.assertEqual(dispatcher.childlog.data[0], "supercalifragilisticexpialidocious")
开发者ID:whenjonny,项目名称:tupppai-tools,代码行数:9,代码来源:test_dispatchers.py


示例12: test_handle_write_event_uncaught_raised

 def test_handle_write_event_uncaught_raised(self):
     options = DummyOptions()
     config = DummyPConfig(options, 'test', '/test')
     process = DummyProcess(config)
     dispatcher = self._makeOne(process)
     dispatcher.input_buffer = 'halloooo'
     import errno
     options.write_error = errno.EBADF
     self.assertRaises(OSError, dispatcher.handle_write_event)
开发者ID:1T,项目名称:supervisor,代码行数:9,代码来源:test_dispatchers.py


示例13: test_handle_read_event_logging_nologs

 def test_handle_read_event_logging_nologs(self):
     options = DummyOptions()
     options.readfd_result = 'supercalifragilisticexpialidocious'
     config = DummyPConfig(options, 'process1', '/bin/process1')
     process = DummyProcess(config)
     dispatcher = self._makeOne(process)
     # just make sure there are no errors if a child logger doesnt
     # exist
     self.assertEqual(dispatcher.handle_read_event(), None)
     self.assertEqual(dispatcher.childlog, None)
开发者ID:1T,项目名称:supervisor,代码行数:10,代码来源:test_dispatchers.py


示例14: test_handle_write_event_over_os_limit

 def test_handle_write_event_over_os_limit(self):
     options = DummyOptions()
     config = DummyPConfig(options, 'test', '/test')
     process = DummyProcess(config)
     dispatcher = self._makeOne(process)
     options.write_accept = 1
     dispatcher.input_buffer = 'a' * 50
     dispatcher.handle_write_event()
     self.assertEqual(len(dispatcher.input_buffer), 49)
     self.assertEqual(options.written[0], 'a')
开发者ID:1T,项目名称:supervisor,代码行数:10,代码来源:test_dispatchers.py


示例15: test_runforever_emits_generic_startup_event

 def test_runforever_emits_generic_startup_event(self):
     from supervisor import events
     L = []
     def callback(event):
         L.append(1)
     events.subscribe(events.SupervisorStateChangeEvent, callback)
     options = DummyOptions()
     supervisord = self._makeOne(options)
     options.test = True
     supervisord.runforever()
     self.assertEqual(L, [1])
开发者ID:GulsahKose,项目名称:supervisor,代码行数:11,代码来源:test_supervisord.py


示例16: test_handle_read_event_no_data_closes

 def test_handle_read_event_no_data_closes(self):
     options = DummyOptions()
     options.readfd_result = ''
     config = DummyPConfig(options, 'process1', '/bin/process1',
                           stdout_capture_maxbytes=100)
     process = DummyProcess(config)
     dispatcher = self._makeOne(process)
     self.assertFalse(dispatcher.closed)
     self.assertEqual(dispatcher.handle_read_event(), None)
     self.assertEqual(dispatcher.output_buffer, '')
     self.assertTrue(dispatcher.closed)
开发者ID:1T,项目名称:supervisor,代码行数:11,代码来源:test_dispatchers.py


示例17: test_handle_read_event_logging_childlog

 def test_handle_read_event_logging_childlog(self):
     options = DummyOptions()
     options.readfd_result = 'supercalifragilisticexpialidocious'
     config = DummyPConfig(options, 'process1', '/bin/process1',
                           stdout_logfile=os.path.join(tempfile.gettempdir(), 'foo.txt'))
     process = DummyProcess(config)
     dispatcher = self._makeOne(process)
     self.assertEqual(dispatcher.handle_read_event(), None)
     self.assertEqual(len(dispatcher.childlog.data), 1)
     self.assertEqual(dispatcher.childlog.data[0],
                      'supercalifragilisticexpialidocious')
开发者ID:alexsilva,项目名称:supervisor,代码行数:11,代码来源:test_dispatchers.py


示例18: test_runforever_emits_generic_specific_event

 def test_runforever_emits_generic_specific_event(self):
     from supervisor import events
     L = []
     def callback(event):
         L.append(2)
     events.subscribe(events.SupervisorRunningEvent, callback)
     options = DummyOptions()
     options.test = True
     supervisord = self._makeOne(options)
     supervisord.runforever()
     self.assertEqual(L, [2])
开发者ID:GulsahKose,项目名称:supervisor,代码行数:11,代码来源:test_supervisord.py


示例19: test_handle_sigchld

 def test_handle_sigchld(self):
     options = DummyOptions()
     options._signal = signal.SIGCHLD
     supervisord = self._makeOne(options)
     supervisord.handle_signal()
     self.assertEqual(supervisord.options.mood, 1)
     # supervisor.options.signame(signal.SIGCHLD) may return "SIGCLD"
     # on linux or other systems where SIGCHLD = SIGCLD.
     msgs = ('received SIGCHLD indicating a child quit',
             'received SIGCLD indicating a child quit')
     self.assertTrue(options.logger.data[0] in msgs)
开发者ID:GulsahKose,项目名称:supervisor,代码行数:11,代码来源:test_supervisord.py


示例20: test_handle_read_event_nodata

 def test_handle_read_event_nodata(self):
     options = DummyOptions()
     options.readfd_result = ''
     config = DummyPConfig(options, 'process1', '/bin/process1')
     process = DummyProcess(config)
     dispatcher = self._makeOne(process)
     self.assertEqual(dispatcher.handle_read_event(), None)
     self.assertEqual(dispatcher.state_buffer, '')
     from supervisor.dispatchers import EventListenerStates
     self.assertEqual(dispatcher.process.listener_state,
                      EventListenerStates.ACKNOWLEDGED)
开发者ID:1T,项目名称:supervisor,代码行数:11,代码来源:test_dispatchers.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python base.DummyProcess类代码示例发布时间:2022-05-27
下一篇:
Python supervisord.main函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap