Exemplo n.º 1
0
def wait_until_model_status_code_is(step, code1, code2, secs):
    start = datetime.utcnow()
    read.i_get_the_model(step, world.model['resource'])
    status = get_status(world.model)
    while (status['code'] != int(code1) and status['code'] != int(code2)):
        time.sleep(3)
        assert datetime.utcnow() - start < timedelta(seconds=int(secs))
        read.i_get_the_model(step, world.model['resource'])
        status = get_status(world.model)
    assert status['code'] == int(code1)
Exemplo n.º 2
0
def wait_until_model_status_code_is(step, code1, code2, secs):
    start = datetime.utcnow()
    delta = int(secs) * world.delta
    read.i_get_the_model(step, world.model['resource'])
    status = get_status(world.model)
    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_model(step, world.model['resource'])
        status = get_status(world.model)
    eq_(status['code'], int(code1))
Exemplo n.º 3
0
def wait_until_model_status_code_is(step, code1, code2, secs):
    start = datetime.utcnow()
    read.i_get_the_model(step, world.model['resource'])
    status = get_status(world.model)
    while (status['code'] != int(code1) and
           status['code'] != int(code2)):
           time.sleep(3)
           assert datetime.utcnow() - start < timedelta(seconds=int(secs))
           read.i_get_the_model(step, world.model['resource'])
           status = get_status(world.model)
    assert status['code'] == int(code1)
Exemplo n.º 4
0
def wait_until_model_status_code_is(step, code1, code2, secs):
    start = datetime.utcnow()
    delta = int(secs) * world.delta
    read.i_get_the_model(step, world.model['resource'])
    status = get_status(world.model)
    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_model(step, world.model['resource'])
           status = get_status(world.model)
    eq_(status['code'], int(code1))
Exemplo n.º 5
0
def wait_until_model_status_code_is(step, code1, code2, secs):
    start = datetime.utcnow()
    delta = int(secs) * world.delta
    read.i_get_the_model(step, world.model['resource'])
    status = get_status(world.model)
    count = 0
    while (status['code'] != int(code1) and status['code'] != int(code2)):
        count += 1
        logged_wait(start, delta, count, "model")
        assert_less((datetime.utcnow() - start).seconds, delta)
        read.i_get_the_model(step, world.model['resource'])
        status = get_status(world.model)
    eq_(status['code'], int(code1))