Skip to content

Commit 19f0970

Browse files
committed
Error tests
1 parent c5d6cac commit 19f0970

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/session_test.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,24 @@ def test_can_run_simple_statement(self):
6565
session.close()
6666
assert count == 1
6767

68+
def test_fails_on_bad_syntax(self):
69+
session = GraphDatabase.driver("bolt://localhost").session()
70+
try:
71+
session.run("X").consume()
72+
except CypherError:
73+
assert True
74+
else:
75+
assert False
76+
77+
def test_fails_on_missing_parameter(self):
78+
session = GraphDatabase.driver("bolt://localhost").session()
79+
try:
80+
session.run("RETURN {x}").consume()
81+
except CypherError:
82+
assert True
83+
else:
84+
assert False
85+
6886
def test_can_run_simple_statement_from_bytes_string(self):
6987
session = GraphDatabase.driver("bolt://localhost").session()
7088
count = 0

0 commit comments

Comments
 (0)