Exemple #1
0
def setup():
    global conn
    db_disconnect()
    db_connect(db_name, 'localhost', 27017)

    global BASE_PATH
    BASE_PATH = tempfile.mkdtemp()
Exemple #2
0
def fs_setup():
    "Create a fresh database with unique (random) name."
    from filestore.api import db_connect, db_disconnect
    import filestore.conf as fconf

    global conn
    global old_conf

    old_conf = dict(fconf.connection_config)
    db_disconnect()
    test_conf = dict(database=db_name, host='localhost',
                     port=27017)
    install_sentinels(test_conf, 1)
    conn = db_connect(**test_conf)
    old_conf.clear()
    old_conf.update(fconf.connection_config)
    fconf.connection_config.clear()
    fconf.connection_config.update(test_conf)
Exemple #3
0
def setup():
    global conn
    db_disconnect()
    conn = db_connect(db_name, 'localhost', 27017)
    blc = insert_beamline_config({}, ttime.time())

    switch(channelarchiver=False)
    start, end = '2015-01-01 00:00:00', '2015-01-01 00:01:00'
    simulated_ca_data = generate_ca_data(['ch1', 'ch2'], start, end)
    ca.insert_data(simulated_ca_data)

    for i in range(5):
        insert_run_start(time=float(i),
                         scan_id=i + 1,
                         owner='docbrown',
                         beamline_id='example',
                         beamline_config=insert_beamline_config({}, time=0.))
    for i in range(5):
        insert_run_start(time=float(i),
                         scan_id=i + 1,
                         owner='nedbrainard',
                         beamline_id='example',
                         beamline_config=insert_beamline_config({}, time=0.))
Exemple #4
0
def fs_setup():
    "Create a fresh database with unique (random) name."
    global conn
    db_disconnect()
    conn = db_connect(db_name, 'localhost', 27017)
Exemple #5
0
def setup():
    global conn
    db_disconnect()
    db_connect(db_name, 'localhost', 27017)

    register_handler('AD_HDF5', AreaDetectorHDF5Handler)