Ejemplo n.º 1
0
def test_caput_many_no_wait(pvnames):
    print('Simple Test of caput_many() function, without waiting.\n')
    pvs = [pvnames.double_pv, pvnames.enum_pv, 'ceci nest pas une PV']
    vals = [0.5, 0, 23]
    success = caput_many(pvs, vals, wait=None, connection_timeout=0.5)
    assert len(success) == len(pvs)
    # If you don't wait, ca.put returns 1 as long as the PV connects
    # and the put request is valid.
    assert success[0] == 1
    assert success[1] == 1
    assert success[2] < 0
Ejemplo n.º 2
0
def test_caput_many_wait_each(pvnames):
    print('Simple Test of caput_many() function, waiting for each.\n')
    pvs = [pvnames.double_pv, pvnames.enum_pv, 'ceci nest pas une PV']
    #pvs = ["MTEST:Val1", "MTEST:Val2", "MTEST:SlowVal"]
    vals = [0.5, 0, 23]
    success = caput_many(pvs,
                         vals,
                         wait='each',
                         connection_timeout=0.5,
                         put_timeout=1.0)
    assert len(success) == len(pvs)
    assert success[0] == 1
    assert success[1] == 1
    assert success[2] < 0
Ejemplo n.º 3
0
def test_caput_many_wait_all(pvnames):
    print('Test of caput_many() function, waiting for all.\n')
    pvs = [pvnames.double_pv, pvnames.enum_pv, 'ceci nest pas une PV']
    vals = [0.5, 0, 23]
    t0 = time.time()
    success = caput_many(pvs,
                         vals,
                         wait='all',
                         connection_timeout=0.5,
                         put_timeout=5.0)
    t1 = time.time()
    assert len(success) == len(pvs)
    assert success[0] == 1
    assert success[1] == 1
    assert success[2] < 0