Example #1
0
def prj(request):
    if request.param == "arctic":
        connstr = "mongodb://localhost:27017/"
        name = "test_project"
        arc = arctic.Arctic(connstr)
        if name in [lib.split(".")[0] for lib in arc.list_libraries()]:
            connector = pst.ArcticConnector(name, connstr)
            prj = pst.PastaStore(name, connector)
        else:
            connector = pst.ArcticConnector(name, connstr)
            prj = initialize_project(connector)
    elif request.param == "pystore":
        name = "test_project"
        path = "./tests/data/pystore"
        pystore.set_path(path)
        if name in pystore.list_stores():
            connector = pst.PystoreConnector(name, path)
            prj = pst.PastaStore(name, connector)
        else:
            connector = pst.PystoreConnector(name, path)
            prj = initialize_project(connector)
    elif request.param == "dict":
        name = "test_project"
        connector = pst.DictConnector(name)
        prj = initialize_project(connector)
    prj.type = request.param  # added here for defining test dependencies
    yield prj
Example #2
0
def pr(request):
    """Fixture that yields connection object.
    """
    name = f"test_{request.param}"
    # connect to dbase
    if request.param == "arctic":
        connstr = "mongodb://localhost:27017/"
        pr = pst.ArcticConnector(name, connstr)
    elif request.param == "pystore":
        path = "./tests/data/pystore"
        pr = pst.PystoreConnector(name, path)
    elif request.param == "dict":
        pr = pst.DictConnector(name)
    pr.type = request.param  # added here for defining test dependencies
    yield pr
Example #3
0
def conn(request):
    """Fixture that yields connection object.
    """
    name = f"test_{request.param}"
    # connect to dbase
    if request.param == "arctic":
        connstr = "mongodb://localhost:27017/"
        conn = pst.ArcticConnector(name, connstr)
    elif request.param == "pystore":
        path = "./tests/data/pystore"
        conn = pst.PystoreConnector(name, path)
    elif request.param == "dict":
        conn = pst.DictConnector(name)
    elif request.param == "pas":
        conn = pst.PasConnector(name, "./tests/data/pas")
    else:
        raise ValueError("Unrecognized parameter!")
    conn.type = request.param  # added here for defining test dependencies
    yield conn
Example #4
0
def pstore(request):
    if request.param == "arctic":
        connstr = "mongodb://localhost:27017/"
        name = "test_project"
        connector = pst.ArcticConnector(name, connstr)
    elif request.param == "pystore":
        name = "test_project"
        path = "./tests/data/pystore"
        pystore.set_path(path)
        connector = pst.PystoreConnector(name, path)
    elif request.param == "dict":
        name = "test_project"
        connector = pst.DictConnector(name)
    elif request.param == "pas":
        name = "test_project"
        connector = pst.PasConnector(name, "./tests/data/pas")
    else:
        raise ValueError("Unrecognized parameter!")
    pstore = initialize_project(connector)
    pstore.type = request.param  # added here for defining test dependencies
    yield pstore
Example #5
0
def test_benchmark_read_series_pystore(benchmark):
    path = "./tests/data/pystore"
    conn = pst.PystoreConnector("test", path)
    _ = benchmark(series_read, conn=conn)
    return
Example #6
0
def test_benchmark_read_model_pystore(benchmark):
    path = "./tests/data/pystore"
    conn = pst.PystoreConnector("test", path)
    _ = benchmark(read_model, conn=conn)
    pst.util.delete_pystore_connector(conn=conn)
    return
Example #7
0
def test_benchmark_write_model_nocheckts_pystore(benchmark):
    path = "./tests/data/pystore"
    conn = pst.PystoreConnector("test", path)
    ml = build_model(conn)
    _ = benchmark(write_model_nocheckts, conn=conn, ml=ml)
    return