MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / expect_error

Method expect_error

tests/flow/test_call_subquery.py:33–40  ·  view source on GitHub ↗

Run the query and expect an error that contains the given message

(self, query, expected_err_msg)

Source from the content-addressed store, hash-verified

31 return actual_result
32
33 def expect_error(self, query, expected_err_msg):
34 """Run the query and expect an error that contains the given message"""
35
36 try:
37 graph.query(query)
38 assert(False)
39 except redis.exceptions.ResponseError as e:
40 self.env.assertIn(expected_err_msg, str(e))
41
42 def test01_test_validations(self):
43 """Make sure we fail on invalid queries"""

Callers 3

test13_midrun_failMethod · 0.95

Calls 2

strFunction · 0.85
queryMethod · 0.45

Tested by

no test coverage detected