Esempio n. 1
0
def populated_memgraph(dataset_file: str) -> Memgraph:
    memgraph = Memgraph()
    memgraph.ensure_indexes([])
    memgraph.ensure_constraints([])
    memgraph.drop_database()
    with get_data_dir().joinpath(dataset_file).open("r") as dataset:
        for query in dataset:
            memgraph.execute(query)

    yield memgraph

    memgraph.drop_database()
Esempio n. 2
0
def memgraph() -> Memgraph:
    memgraph = Memgraph()
    memgraph.ensure_indexes([])
    memgraph.ensure_constraints([])
    memgraph.drop_database()
    return memgraph