def wait_until_fusion_status_code_is(step, code1, code2, secs): start = datetime.utcnow() read.i_get_the_fusion(step, world.fusion['resource']) status = get_status(world.fusion) 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_fusion(step, world.fusion['resource']) status = get_status(world.fusion) eq_(status['code'], int(code1))
def wait_until_fusion_status_code_is(step, code1, code2, secs): start = datetime.utcnow() delta = int(secs) * world.delta read.i_get_the_fusion(step, world.fusion['resource']) status = get_status(world.fusion) count = 0 while (status['code'] != int(code1) and status['code'] != int(code2)): count += 1 logged_wait(start, delta, count, "fusion") read.i_get_the_fusion(step, world.fusion['resource']) status = get_status(world.fusion) eq_(status['code'], int(code1))
def wait_until_fusion_status_code_is(step, code1, code2, secs): start = datetime.utcnow() delta = int(secs) * world.delta read.i_get_the_fusion(step, world.fusion['resource']) status = get_status(world.fusion) while (status['code'] != int(code1) and status['code'] != int(code2)): time.sleep(3) assert_less(datetime.utcnow() - start, timedelta(seconds=delta)) read.i_get_the_fusion(step, world.fusion['resource']) status = get_status(world.fusion) eq_(status['code'], int(code1))