def wait_until_time_series_status_code_is(step, code1, code2, secs): start = datetime.utcnow() read.i_get_the_time_series(step, world.time_series['resource']) status = get_status(world.time_series) while (status['code'] != int(code1) and status['code'] != int(code2)): time.sleep(3) assert_less(datetime.utcnow() - start, timedelta(seconds=int(secs))) read.i_get_the_time_series(step, world.time_series['resource']) status = get_status(world.time_series) eq_(status['code'], int(code1))
def wait_until_time_series_status_code_is(step, code1, code2, secs): start = datetime.utcnow() read.i_get_the_time_series(step, world.time_series['resource']) status = get_status(world.time_series) while (status['code'] != int(code1) and status['code'] != int(code2)): time.sleep(3) assert_less(datetime.utcnow() - start, timedelta(seconds=int(secs))) read.i_get_the_time_series(step, world.time_series['resource']) status = get_status(world.time_series) eq_(status['code'], int(code1))
def wait_until_time_series_status_code_is(step, code1, code2, secs): start = datetime.utcnow() delta = int(secs) * world.delta read.i_get_the_time_series(step, world.time_series['resource']) status = get_status(world.time_series) count = 0 while (status['code'] != int(code1) and status['code'] != int(code2)): count += 1 logged_wait(start, delta, count, "timeseries") assert_less((datetime.utcnow() - start).seconds, delta) read.i_get_the_time_series(step, world.time_series['resource']) status = get_status(world.time_series) eq_(status['code'], int(code1))