예제 #1
0
def test_delay(func, wait, args, kargs, expected):
    start = time.time() * 1000
    result = _.delay(func, wait, *args, **kargs)
    stop = time.time() * 1000

    assert (wait - 5) <= (stop - start) <= (wait + 5)
    assert result == expected
예제 #2
0
def test_delay(func, wait, args, kargs, expected):
    start = time.time() * 1000
    result = _.delay(func, wait, *args, **kargs)
    stop = time.time() * 1000

    assert (wait - 5) <= (stop - start) <= (wait + 5)
    assert result == expected