예제 #1
0
def test_find_events_smoke():

    num = 50
    rs, e_desc, data_keys = setup_syn()
    all_data = syn_data(data_keys, num)

    mdsc.bulk_insert_events(e_desc, all_data, validate=False)
    mdsc.insert_run_stop(rs, ttime.time(), uid=str(uuid.uuid4()))
    mdsc.clear_process_cache()

    # make sure the uid works
    next(mdsc.find_events(descriptor=e_desc))

    mdsc.clear_process_cache()
    descriptor, = mdsc.find_descriptors(uid=e_desc)

    mdsc.clear_process_cache()
    # make sure that searching by descriptor document works
    next(mdsc.find_events(descriptor=descriptor))
예제 #2
0
def test_find_events_smoke():

    num = 50
    rs, e_desc, data_keys = setup_syn()
    all_data = syn_data(data_keys, num)

    mdsc.bulk_insert_events(e_desc, all_data, validate=False)
    mdsc.insert_run_stop(rs, ttime.time(), uid=str(uuid.uuid4()))
    mdsc.clear_process_cache()

    # make sure the uid works
    next(mdsc.find_events(descriptor=e_desc))

    mdsc.clear_process_cache()
    descriptor, = mdsc.find_descriptors(uid=e_desc)

    mdsc.clear_process_cache()
    # make sure that searching by descriptor document works
    next(mdsc.find_events(descriptor=descriptor))
예제 #3
0
def test_cache_clear_lookups():
    run_start_uid, e_desc_uid, data_keys = setup_syn()
    run_stop_uid = mdsc.insert_run_stop(run_start_uid, ttime.time(), uid=str(uuid.uuid4()))
    run_start = mdsc.run_start_given_uid(run_start_uid)
    run_stop = mdsc.run_stop_given_uid(run_stop_uid)
    ev_desc = mdsc.descriptor_given_uid(e_desc_uid)

    mdsc.clear_process_cache()

    run_start2 = mdsc.run_start_given_uid(run_start_uid)
    mdsc.clear_process_cache()

    run_stop2 = mdsc.run_stop_given_uid(run_stop_uid)
    mdsc.clear_process_cache()
    ev_desc2 = mdsc.descriptor_given_uid(e_desc_uid)
    ev_desc3 = mdsc.descriptor_given_uid(e_desc_uid)

    assert_equal(run_start, run_start2)
    assert_equal(run_stop, run_stop2)
    assert_equal(ev_desc, ev_desc2)
    assert_equal(ev_desc, ev_desc3)
예제 #4
0
def test_cache_clear_lookups():
    run_start_uid, e_desc_uid, data_keys = setup_syn()
    run_stop_uid = mdsc.insert_run_stop(run_start_uid,
                                        ttime.time(),
                                        uid=str(uuid.uuid4()))
    run_start = mdsc.run_start_given_uid(run_start_uid)
    run_stop = mdsc.run_stop_given_uid(run_stop_uid)
    ev_desc = mdsc.descriptor_given_uid(e_desc_uid)

    mdsc.clear_process_cache()

    run_start2 = mdsc.run_start_given_uid(run_start_uid)
    mdsc.clear_process_cache()

    run_stop2 = mdsc.run_stop_given_uid(run_stop_uid)
    mdsc.clear_process_cache()
    ev_desc2 = mdsc.descriptor_given_uid(e_desc_uid)
    ev_desc3 = mdsc.descriptor_given_uid(e_desc_uid)

    assert_equal(run_start, run_start2)
    assert_equal(run_stop, run_stop2)
    assert_equal(ev_desc, ev_desc2)
    assert_equal(ev_desc, ev_desc3)