Ejemplo n.º 1
0
def test_dispatch():
    def _func(a, b):
        return a + b

    uid = np.random.random()
    dispatch(uid, _func, 1, 2)

    assert get(uid) == 3
Ejemplo n.º 2
0
def test_is_running():
    def _func():
        time.sleep(0.1)

    uid = np.random.random()
    dispatch(uid, _func)

    assert is_running(uid)
Ejemplo n.º 3
0
def test_kill():
    def _func():
        time.sleep(1.0)

    uid = np.random.random()
    dispatch(uid, _func)

    kill(uid)
    time.sleep(0.1)
    assert not is_running(uid)