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
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
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
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
def test_benchmark_read_series_arctic(benchmark): connstr = "mongodb://localhost:27017/" conn = pst.ArcticConnector("test", connstr) _ = benchmark(series_read, conn=conn) return
def test_benchmark_read_model_arctic(benchmark): connstr = "mongodb://localhost:27017/" conn = pst.ArcticConnector("test", connstr) _ = benchmark(read_model, conn=conn) pst.util.delete_arctic_connector(conn=conn) return
def test_benchmark_write_model_nocheckts_arctic(benchmark): connstr = "mongodb://localhost:27017/" conn = pst.ArcticConnector("test", connstr) ml = build_model(conn) _ = benchmark(write_model_nocheckts, conn=conn, ml=ml) return
def delete_arctic_test_db(): connstr = "mongodb://localhost:27017/" name = "test_project" connector = pst.ArcticConnector(name, connstr) pst.util.delete_arctic_connector(connector) print("ArcticConnector 'test_project' deleted.")