memgraph/tests/e2e/mock_api/common.py
2023-03-07 15:41:19 +01:00

15 lines
336 B
Python

import typing
import mgclient
def connect(**kwargs) -> mgclient.Connection:
connection = mgclient.connect(host="localhost", port=7687, **kwargs)
connection.autocommit = True
return connection
def execute_and_fetch_results_dict(cursor, query) -> typing.Dict:
cursor.execute(query)
return cursor.fetchall()[0][0]