def wait_until_execution_status_code_is(step, code1, code2, secs): start = datetime.utcnow() execution_id = world.execution['resource'] i_get_the_execution(step, execution_id) status = get_status(world.execution) while (status['code'] != int(code1) and status['code'] != int(code2)): time.sleep(3) assert_less(datetime.utcnow() - start, timedelta(seconds=int(secs))) i_get_the_execution(step, execution_id) status = get_status(world.execution) eq_(status['code'], int(code1))
def wait_until_execution_status_code_is(step, code1, code2, secs): start = datetime.utcnow() execution_id = world.execution['resource'] i_get_the_execution(step, execution_id) status = get_status(world.execution) while (status['code'] != int(code1) and status['code'] != int(code2)): time.sleep(3) assert datetime.utcnow() - start < timedelta(seconds=int(secs)) i_get_the_execution(step, execution_id) status = get_status(world.execution) assert status['code'] == int(code1)
def wait_until_execution_status_code_is(step, code1, code2, secs): start = datetime.utcnow() delta = int(secs) * world.delta execution_id = world.execution['resource'] i_get_the_execution(step, execution_id) status = get_status(world.execution) while (status['code'] != int(code1) and status['code'] != int(code2)): time.sleep(3) assert_less(datetime.utcnow() - start, timedelta(seconds=delta)) i_get_the_execution(step, execution_id) status = get_status(world.execution) eq_(status['code'], int(code1))
def wait_until_execution_status_code_is(step, code1, code2, secs): start = datetime.utcnow() delta = int(secs) * world.delta execution_id = world.execution['resource'] i_get_the_execution(step, execution_id) status = get_status(world.execution) count = 0 while (status['code'] != int(code1) and status['code'] != int(code2)): count += 1 logged_wait(start, delta, count, "execution") assert_less((datetime.utcnow() - start).seconds, delta) i_get_the_execution(step, execution_id) status = get_status(world.execution) eq_(status['code'], int(code1))