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


Python SimpleExecutor.stop方法代码示例

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


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

示例1: test_stop_custom_signal_stop

# 需要导入模块: from mirakuru.base import SimpleExecutor [as 别名]
# 或者: from mirakuru.base.SimpleExecutor import stop [as 别名]
def test_stop_custom_signal_stop():
    """Start process and shuts it down using signal SIGQUIT passed to stop."""
    executor = SimpleExecutor(sleep_300)
    executor.start()
    assert executor.running() is True
    executor.stop(sig=signal.SIGQUIT)
    assert executor.running() is False
开发者ID:jotes,项目名称:mirakuru,代码行数:9,代码来源:test_executor.py

示例2: test_process_output_shell

# 需要导入模块: from mirakuru.base import SimpleExecutor [as 别名]
# 或者: from mirakuru.base.SimpleExecutor import stop [as 别名]
def test_process_output_shell(command):
    """Start process, check output and shut it down with shell set to True."""
    executor = SimpleExecutor(command, shell=True)
    executor.start()

    assert executor.output().read() == 'foobar'
    executor.stop()
开发者ID:jotes,项目名称:mirakuru,代码行数:9,代码来源:test_executor.py

示例3: test_process_output

# 需要导入模块: from mirakuru.base import SimpleExecutor [as 别名]
# 或者: from mirakuru.base.SimpleExecutor import stop [as 别名]
def test_process_output(command):
    """Start process, check output and shut it down."""
    executor = SimpleExecutor(command)
    executor.start()

    assert executor.output().read() == 'foobar'
    executor.stop()
开发者ID:jotes,项目名称:mirakuru,代码行数:9,代码来源:test_executor.py

示例4: test_custom_signal_stop

# 需要导入模块: from mirakuru.base import SimpleExecutor [as 别名]
# 或者: from mirakuru.base.SimpleExecutor import stop [as 别名]
def test_custom_signal_stop():
    """Start process and shuts it down using signal SIGQUIT."""
    executor = SimpleExecutor(SLEEP_300, sig_stop=signal.SIGQUIT)
    executor.start()
    assert executor.running() is True
    executor.stop()
    assert executor.running() is False
开发者ID:ClearcodeHQ,项目名称:mirakuru,代码行数:9,代码来源:test_executor.py

示例5: test_running_process

# 需要导入模块: from mirakuru.base import SimpleExecutor [as 别名]
# 或者: from mirakuru.base.SimpleExecutor import stop [as 别名]
def test_running_process(command):
    """Start process and shuts it down."""
    executor = SimpleExecutor(command)
    executor.start()
    assert executor.running() is True
    executor.stop()
    assert executor.running() is False

    # check proper __str__ and __repr__ rendering:
    assert 'SimpleExecutor' in repr(executor)
    assert 'sleep 300' in str(executor)
开发者ID:jotes,项目名称:mirakuru,代码行数:13,代码来源:test_executor.py

示例6: test_stopping_not_yet_running_executor

# 需要导入模块: from mirakuru.base import SimpleExecutor [as 别名]
# 或者: from mirakuru.base.SimpleExecutor import stop [as 别名]
def test_stopping_not_yet_running_executor():
    """
    Test if SimpleExecutor can be stopped even it was never running.

    We must make sure that it's possible to call .stop() and SimpleExecutor
    will not raise any exception and .start() can be called afterwards.
    """
    executor = SimpleExecutor(sleep_300)
    executor.stop()
    executor.start()
    assert executor.running() is True
    executor.stop()
开发者ID:jotes,项目名称:mirakuru,代码行数:14,代码来源:test_executor.py


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