示例#1
0
def test_normalize_scan(ami_det, ami_det_2, RE):
    logger.debug('test_normalize_scan')
    ami_det.min_duration = 1
    ami_det.normalize = ami_det_2
    set_monitor_det(ami_det_2)
    RE(count([ami_det, ami_det_2], num=5))
    RE(count([ami_det], num=5))
    RE(count([ami_det_2], num=5))
示例#2
0
def test_normalize_error(ami_det, ami_det_2):
    logger.debug('test_normalize_error')
    set_monitor_det(ami_det_2)
    ami_det_2.stage()
    ami_det_2._entry._values = []
    with pytest.raises(RuntimeError):
        ami_det.get()
    ami_det.stage()
    ami_det.get()
    assert ami_det.mean_mon.get() == 0
示例#3
0
def test_set_monitor_det(ami_det):
    logger.debug('test_set_monitor_det')
    set_monitor_det(ami_det)
    assert pcdsdaq.ami.monitor_det is ami_det
    set_monitor_det(False)
    assert pcdsdaq.ami.monitor_det is None
示例#4
0
def test_dets_filter_default_arg(ami_det):
    logger.debug('test_dets_filter_default_arg')
    with pytest.raises(RuntimeError):
        dets_filter(0, 1)
    set_monitor_det(ami_det)
    assert ami_det.prefix in dets_filter(0, 1)