Files
memgraph/tests/e2e/util_e2e/simple_case_nullcheck.py
2022-06-29 16:31:51 +02:00

24 lines
546 B
Python

import typing
import mgclient
import sys
import pytest
def test_nullcheck_yields_error(connection):
cursor = connection.cursor()
query = """WITH 2 AS name
RETURN CASE name
WHEN 3 THEN 'works'
WHEN null THEN "doesn't work"
ELSE 'something went wrong'
END"""
cursor.execute(query)
row = cursor.fetchone()
assert row == "Use the generic form when checking against NULL."
if __name__ == "__main__":
sys.exit(pytest.main([__file__, "-rA"]))