Exemple #1
0
def test_skip_failures():
    logger.debug('test_skip_failures')
    # Should not raise
    load_conf(
        dict(hutch=345243,
             db=12351324,
             experiment=2341234,
             load=123454,
             bananas='dole'))
Exemple #2
0
def test_auto_experiment(fake_curexp_script):
    logger.debug('test_auto_experiment')
    hutch_python.qs_load.QSBackend = QSBackend
    objs = load_conf(dict(hutch='tst'))
    assert objs['inj_x'].run == '15'
    assert objs['inj_x'].proposal == 'LR12'
    assert objs['x'].inj_x == objs['inj_x']
Exemple #3
0
def test_conf_platform():
    logger.debug('test_conf_platform')
    set_sim_mode(True)
    # No platform
    objs = load_conf({})
    assert objs['daq']._plat == 0
    # Define default platform
    objs = load_conf({'daq_platform': {'default': 1}})
    assert objs['daq']._plat == 1
    # Define host platform
    hostname = gethostname()
    objs = load_conf({'daq_platform': {hostname: 2}})
    assert objs['daq']._plat == 2
    # Define both
    objs = load_conf({'daq_platform': {'default': 3, hostname: 4}})
    assert objs['daq']._plat == 4
Exemple #4
0
def test_elog(monkeypatch, temporary_config):
    monkeypatch.setattr(hutch_python.load_conf, 'HutchELog', ELog)
    # No platform
    objs = load_conf({'hutch': 'TST'})
    assert objs['elog'].station is None
    # Check authentication worked correctly
    assert objs['elog'].user == 'user'
    assert objs['elog'].pw == 'pw'
    # Define default platform
    objs = load_conf({'daq_platform': {'default': 1}, 'hutch': 'TST'})
    assert objs['elog'].station is None
    # Define host platform
    hostname = gethostname()
    objs = load_conf({
        'daq_platform': {
            'default': 3,
            hostname: 4
        },
        'hutch': 'TST'
    })
    assert objs['elog'].station == '1'
Exemple #5
0
def test_conf_empty():
    logger.debug('test_conf_empty')
    objs = load_conf({})
    assert len(objs) > 1
Exemple #6
0
def test_cannot_auto():
    logger.debug('test_cannot_auto')
    # Fail silently
    load_conf(dict(hutch='tst'))
def test_camviewer_load(monkeypatch):
    logger.debug('test_camviewer_load')
    monkeypatch.setattr(hutch_python.load_conf, 'CAMVIEWER_CFG', TST_CAM_CFG)
    objs = load_conf({'hutch': ''})
    assert 'my_cam' in objs