예제 #1
0
def wait_until_association_status_code_is(step, code1, code2, secs):
    start = datetime.utcnow()
    association_id = world.association['resource']
    i_get_the_association(step, association_id)
    status = get_status(world.association)
    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_association(step, association_id)
        status = get_status(world.association)
    eq_(status['code'], int(code1))
def wait_until_association_status_code_is(step, code1, code2, secs):
    start = datetime.utcnow()
    association_id = world.association['resource']
    i_get_the_association(step, association_id)
    status = get_status(world.association)
    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_association(step, association_id)
           status = get_status(world.association)
    eq_(status['code'], int(code1))
예제 #3
0
def wait_until_association_status_code_is(step, code1, code2, secs):
    start = datetime.utcnow()
    delta = int(secs) * world.delta
    association_id = world.association['resource']
    i_get_the_association(step, association_id)
    status = get_status(world.association)
    count = 0
    while (status['code'] != int(code1) and status['code'] != int(code2)):
        count += 1
        logged_wait(start, delta, count, "association")
        i_get_the_association(step, association_id)
        status = get_status(world.association)
    eq_(status['code'], int(code1))