Skip to content

Commit ec313a1

Browse files
authored
#2114 add test for named parameterized Cypher query handling (#2410)
1 parent 3a08ebe commit ec313a1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

e2e-python/tests/test_arcadedb.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,21 @@ def test_psycopg2_with_named_parameterized_query():
214214
finally:
215215
conn.close()
216216

217+
def test_psycopg2_with_named_parameterized_cypher_query():
218+
"""Check if the driver correctly handles parameterized named queries"""
219+
params = get_connection_params(arcadedb)
220+
conn = psycopg.connect(**params)
221+
conn.autocommit = True
222+
223+
try:
224+
with conn.cursor() as cursor:
225+
query_params = {'name': 'Stout'}
226+
cursor.execute('{cypher} MATCH (b:Beer) WHERE b.name =%(name)s RETURN b', query_params)
227+
beer = cursor.fetchall()[0]
228+
assert 'Stout' in beer
229+
finally:
230+
conn.close()
231+
217232

218233
def test_psycopg2_with_positional_parameterized_query():
219234
"""Check if the driver correctly handles parameterized positional queries"""

0 commit comments

Comments
 (0)