本文整理汇总了Python中supervisor.tests.base.DummyProcessGroup.processes方法的典型用法代码示例。如果您正苦于以下问题:Python DummyProcessGroup.processes方法的具体用法?Python DummyProcessGroup.processes怎么用?Python DummyProcessGroup.processes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类supervisor.tests.base.DummyProcessGroup
的用法示例。
在下文中一共展示了DummyProcessGroup.processes方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_removeProcessFromGroup_raises_bad_name_when_process_does_not_exist
# 需要导入模块: from supervisor.tests.base import DummyProcessGroup [as 别名]
# 或者: from supervisor.tests.base.DummyProcessGroup import processes [as 别名]
def test_removeProcessFromGroup_raises_bad_name_when_process_does_not_exist(self):
pconfig = DummyPConfig(None, 'foo', '/bin/foo')
gconfig = DummyPGroupConfig(None, pconfigs=[pconfig])
pgroup = DummyProcessGroup(gconfig)
pgroup.processes = {}
supervisord = DummySupervisor(process_groups = {'group_name': pgroup})
interface = self.makeOne(supervisord)
self.assertRPCError(SupervisorFaults.BAD_NAME,
interface.removeProcessFromGroup,
'group_name', 'nonexistant_process_name')
示例2: test_removeProcessFromGroup_transitions_process_group
# 需要导入模块: from supervisor.tests.base import DummyProcessGroup [as 别名]
# 或者: from supervisor.tests.base.DummyProcessGroup import processes [as 别名]
def test_removeProcessFromGroup_transitions_process_group(self):
pconfig = DummyPConfig(None, 'foo', '/bin/foo')
process = DummyProcess(pconfig, ProcessStates.EXITED)
gconfig = DummyPGroupConfig(None, pconfigs=[pconfig])
pgroup = DummyProcessGroup(gconfig)
pgroup.processes = { 'process_name': process }
supervisord = DummySupervisor(process_groups = {'group_name': pgroup})
interface = self.makeOne(supervisord)
result = interface.removeProcessFromGroup('group_name', 'process_name')
self.assertTrue(result)
self.assertTrue(pgroup.transitioned)
示例3: test_removeProcessFromGroup_deletes_the_process
# 需要导入模块: from supervisor.tests.base import DummyProcessGroup [as 别名]
# 或者: from supervisor.tests.base.DummyProcessGroup import processes [as 别名]
def test_removeProcessFromGroup_deletes_the_process(self):
pconfig = DummyPConfig(None, 'foo', '/bin/foo')
process = DummyProcess(pconfig, ProcessStates.STOPPED)
gconfig = DummyPGroupConfig(None, pconfigs=[pconfig])
pgroup = DummyProcessGroup(gconfig)
pgroup.processes = { 'process_name': process }
supervisord = DummySupervisor(process_groups = {'group_name': pgroup})
interface = self.makeOne(supervisord)
result = interface.removeProcessFromGroup('group_name', 'process_name')
self.assertTrue(result)
self.assertTrue(pgroup.processes.get('process_name') is None)
self.assertEqual('removeProcessFromGroup', interface.update_text)
示例4: test_removeProcessFromGroup_raises_still_running_when_process_has_pid
# 需要导入模块: from supervisor.tests.base import DummyProcessGroup [as 别名]
# 或者: from supervisor.tests.base.DummyProcessGroup import processes [as 别名]
def test_removeProcessFromGroup_raises_still_running_when_process_has_pid(self):
pconfig = DummyPConfig(None, 'foo', '/bin/foo')
process = DummyProcess(pconfig)
process.pid = 42
gconfig = DummyPGroupConfig(None, pconfigs=[pconfig])
pgroup = DummyProcessGroup(gconfig)
pgroup.processes = { 'process_with_pid': process }
supervisord = DummySupervisor(process_groups = {'group_name': pgroup})
interface = self.makeOne(supervisord)
self.assertRPCError(SupervisorFaults.STILL_RUNNING,
interface.removeProcessFromGroup,
'group_name', 'process_with_pid')
示例5: test_addProgramToGroup_adds_all_processes_resulting_from_program_options
# 需要导入模块: from supervisor.tests.base import DummyProcessGroup [as 别名]
# 或者: from supervisor.tests.base.DummyProcessGroup import processes [as 别名]
def test_addProgramToGroup_adds_all_processes_resulting_from_program_options(self):
gconfig = DummyPGroupConfig(None, pconfigs=[])
pgroup = DummyProcessGroup(gconfig)
pgroup.processes = {}
supervisord = DummySupervisor(process_groups = {'group_name': pgroup})
supervisord.options = supervisor.options.ServerOptions()
interface = self.makeOne(supervisord)
poptions = {'command': '/usr/bin/find /',
'process_name': 'find_%(process_num)d',
'numprocs': 3}
self.assertTrue(interface.addProgramToGroup('group_name', 'new_process', poptions))
self.assertEqual('addProgramToGroup', interface.update_text)
self.assertEqual(3, len(pgroup.config.process_configs))
self.assertEqual(3, len(pgroup.processes))
示例6: test_addProgramToGroup_adds_new_process_config_to_group
# 需要导入模块: from supervisor.tests.base import DummyProcessGroup [as 别名]
# 或者: from supervisor.tests.base.DummyProcessGroup import processes [as 别名]
def test_addProgramToGroup_adds_new_process_config_to_group(self):
pconfig = DummyPConfig(None, 'foo', '/bin/foo')
gconfig = DummyPGroupConfig(None, pconfigs=[pconfig])
pgroup = DummyProcessGroup(gconfig)
pgroup.processes = {}
supervisord = DummySupervisor(process_groups = {'group_name': pgroup})
supervisord.options = supervisor.options.ServerOptions()
interface = self.makeOne(supervisord)
poptions = {'command': '/usr/bin/find /'}
self.assertTrue(interface.addProgramToGroup('group_name', 'new_process', poptions))
self.assertEqual('addProgramToGroup', interface.update_text)
config = pgroup.config.process_configs[1]
self.assertEqual('new_process', config.name)
self.assertTrue(isinstance(config, supervisor.options.ProcessConfig))
示例7: test_addProgramToGroup_uses_process_name_from_options
# 需要导入模块: from supervisor.tests.base import DummyProcessGroup [as 别名]
# 或者: from supervisor.tests.base.DummyProcessGroup import processes [as 别名]
def test_addProgramToGroup_uses_process_name_from_options(self):
gconfig = DummyPGroupConfig(None, pconfigs=[])
pgroup = DummyProcessGroup(gconfig)
pgroup.processes = {}
supervisord = DummySupervisor(process_groups = {'group_name': pgroup})
supervisord.options = supervisor.options.ServerOptions()
interface = self.makeOne(supervisord)
poptions = {'process_name': 'renamed', 'command': '/usr/bin/find /'}
self.assertTrue(interface.addProgramToGroup('group_name', 'new_process', poptions))
self.assertEqual('addProgramToGroup', interface.update_text)
config = pgroup.config.process_configs[0]
self.assertEqual('renamed', config.name)
self.assertTrue(pgroup.processes.get('new_process') is None)
self.assertTrue(isinstance(pgroup.processes.get('renamed'),
supervisor.process.Subprocess))