Exemplo n.º 1
0
def test_wait_with_kill(test):
    """Tests wait(kill = ...)."""

    start_time = time.time()
    process = sh.sleep("3").execute(wait=False)
    assert process.wait(kill=signal.SIGTERM) == 143
    assert time.time() < start_time + 1
Exemplo n.º 2
0
def test_wait_with_kill(test):
    """Tests wait(kill = ...)."""

    start_time = time.time()
    process = sh.sleep("3").execute(wait = False)
    assert process.wait(kill = signal.SIGTERM) == 143
    assert time.time() < start_time + 1
Exemplo n.º 3
0
def test_wait(test):
    """Tests wait()."""

    start_time = time.time()
    process = sh.sleep("3").execute(wait=False)
    assert time.time() < start_time + 1
    assert process.wait() == 0
    assert time.time() >= start_time + 3
Exemplo n.º 4
0
def test_kill(test):
    """Tests kill()."""

    start_time = time.time()
    process = sh.sleep("3").execute(wait=False)
    process.kill()
    assert process.wait() == 143
    assert time.time() < start_time + 1
Exemplo n.º 5
0
def test_wait(test):
    """Tests wait()."""

    start_time = time.time()
    process = sh.sleep("3").execute(wait = False)
    assert time.time() < start_time + 1
    assert process.wait() == 0
    assert time.time() >= start_time + 3
Exemplo n.º 6
0
def test_kill(test):
    """Tests kill()."""

    start_time = time.time()
    process = sh.sleep("3").execute(wait = False)
    process.kill()
    assert process.wait() == 143
    assert time.time() < start_time + 1