示例#1
0
def test_find_run_start():
    run_start_uid, e_desc_uid, data_keys = setup_syn()
    mdsc.insert_run_stop(run_start_uid, ttime.time(), uid=str(uuid.uuid4()))

    run_start = mdsc.run_start_given_uid(run_start_uid)

    run_start2, = list(mdsc.find_run_starts(uid=run_start_uid))

    assert_equal(run_start, run_start2)
示例#2
0
def test_find_run_start():
    run_start_uid, e_desc_uid, data_keys = setup_syn()
    mdsc.insert_run_stop(run_start_uid, ttime.time(), uid=str(uuid.uuid4()))

    run_start = mdsc.run_start_given_uid(run_start_uid)

    run_start2, = list(mdsc.find_run_starts(uid=run_start_uid))

    assert_equal(run_start, run_start2)
示例#3
0
def test_find_run_stop():
    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)
 
    run_stop2, = list(mdsc.find_run_stops(run_start=run_start_uid))
    run_stop3, = list(mdsc.find_run_stops(run_start=run_start))
    assert_equal(run_stop, run_stop2)
    assert_equal(run_stop, run_stop3)
示例#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)
示例#5
0
def test_find_run_stop():
    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)

    run_stop2, = list(mdsc.find_run_stops(run_start=run_start_uid))
    run_stop3, = list(mdsc.find_run_stops(run_start=run_start))
    assert_equal(run_stop, run_stop2)
    assert_equal(run_stop, run_stop3)
示例#6
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)
示例#7
0
def test_run_stop_by_run_start():
    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)

    run_stop2 = mdsc.stop_by_start(run_start)
    run_stop3 = mdsc.stop_by_start(run_start_uid)
    assert_equal(run_stop, run_stop2)
    assert_equal(run_stop, run_stop3)

    ev_desc2 = mdsc.descriptors_by_start(run_start)
    ev_desc3 = mdsc.descriptors_by_start(run_start_uid)
    assert_equal(ev_desc, ev_desc2)
    assert_equal(ev_desc, ev_desc3)
示例#8
0
def test_run_stop_by_run_start():
    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)

    run_stop2 = mdsc.stop_by_start(run_start)
    run_stop3 = mdsc.stop_by_start(run_start_uid)
    assert_equal(run_stop, run_stop2)
    assert_equal(run_stop, run_stop3)

    ev_desc2 = mdsc.descriptors_by_start(run_start)
    ev_desc3 = mdsc.descriptors_by_start(run_start_uid)
    # descriptors_by_start returns a list
    assert_equal(ev_desc, ev_desc2[0])
    assert_equal(ev_desc, ev_desc3[0])