本文整理汇总了Python中supervisor.tests.base.DummyOptions.first方法的典型用法代码示例。如果您正苦于以下问题:Python DummyOptions.first方法的具体用法?Python DummyOptions.first怎么用?Python DummyOptions.first使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类supervisor.tests.base.DummyOptions
的用法示例。
在下文中一共展示了DummyOptions.first方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_main_first
# 需要导入模块: from supervisor.tests.base import DummyOptions [as 别名]
# 或者: from supervisor.tests.base.DummyOptions import first [as 别名]
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)
示例2: test_main_notfirst
# 需要导入模块: from supervisor.tests.base import DummyOptions [as 别名]
# 或者: from supervisor.tests.base.DummyOptions import first [as 别名]
def test_main_notfirst(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 = False
supervisord = self._makeOne(options)
supervisord.main()
self.assertEqual(options.environment_processed, True)
self.assertEqual(options.fds_cleaned_up, True)
self.assertFalse(hasattr(options, 'rlimits_set'))
self.assertEqual(options.make_logger_messages,
(['setuid_called'], [], []))
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, False)
self.assertEqual(options.pidfile_written, True)
self.assertEqual(options.cleaned_up, True)