Ejemplo n.º 1
0
def wait_until_library_status_code_is(step, code1, code2, secs):
    start = datetime.utcnow()
    library_id = world.library['resource']
    i_get_the_library(step, library_id)
    status = get_status(world.library)
    while (status['code'] != int(code1) and status['code'] != int(code2)):
        time.sleep(3)
        assert datetime.utcnow() - start < timedelta(seconds=int(secs))
        i_get_the_library(step, library_id)
        status = get_status(world.library)
    assert status['code'] == int(code1)
Ejemplo n.º 2
0
def wait_until_library_status_code_is(step, code1, code2, secs):
    start = datetime.utcnow()
    delta = int(secs) * world.delta
    library_id = world.library['resource']
    i_get_the_library(step, library_id)
    status = get_status(world.library)
    while (status['code'] != int(code1) and status['code'] != int(code2)):
        time.sleep(3)
        assert_less(datetime.utcnow() - start, timedelta(seconds=delta))
        i_get_the_library(step, library_id)
        status = get_status(world.library)
    eq_(status['code'], int(code1))
Ejemplo n.º 3
0
def wait_until_library_status_code_is(step, code1, code2, secs):
    start = datetime.utcnow()
    library_id = world.library['resource']
    i_get_the_library(step, library_id)
    status = get_status(world.library)
    while (status['code'] != int(code1) and
           status['code'] != int(code2)):
           time.sleep(3)
           assert datetime.utcnow() - start < timedelta(seconds=int(secs))
           i_get_the_library(step, library_id)
           status = get_status(world.library)
    assert status['code'] == int(code1)
Ejemplo n.º 4
0
def wait_until_library_status_code_is(step, code1, code2, secs):
    start = datetime.utcnow()
    delta = int(secs) * world.delta
    library_id = world.library['resource']
    i_get_the_library(step, library_id)
    status = get_status(world.library)
    count = 0
    while (status['code'] != int(code1) and status['code'] != int(code2)):
        count += 1
        logged_wait(start, delta, count, "library")
        assert_less((datetime.utcnow() - start).seconds, delta)
        i_get_the_library(step, library_id)
        status = get_status(world.library)
    eq_(status['code'], int(code1))