|
|
|
@ -88,3 +88,31 @@ def test_neo4j_timeout() -> None:
|
|
|
|
|
e.code
|
|
|
|
|
== "Neo.ClientError.Transaction.TransactionTimedOutClientConfiguration"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_neo4j_sanitize_values() -> None:
|
|
|
|
|
"""Test that neo4j uses the timeout correctly."""
|
|
|
|
|
url = os.environ.get("NEO4J_URI")
|
|
|
|
|
username = os.environ.get("NEO4J_USERNAME")
|
|
|
|
|
password = os.environ.get("NEO4J_PASSWORD")
|
|
|
|
|
assert url is not None
|
|
|
|
|
assert username is not None
|
|
|
|
|
assert password is not None
|
|
|
|
|
|
|
|
|
|
graph = Neo4jGraph(url=url, username=username, password=password, sanitize=True)
|
|
|
|
|
# Delete all nodes in the graph
|
|
|
|
|
graph.query("MATCH (n) DETACH DELETE n")
|
|
|
|
|
# Create two nodes and a relationship
|
|
|
|
|
graph.query(
|
|
|
|
|
"""
|
|
|
|
|
CREATE (la:LabelA {property_a: 'a'})
|
|
|
|
|
CREATE (lb:LabelB)
|
|
|
|
|
CREATE (lc:LabelC)
|
|
|
|
|
MERGE (la)-[:REL_TYPE]-> (lb)
|
|
|
|
|
MERGE (la)-[:REL_TYPE {rel_prop: 'abc'}]-> (lc)
|
|
|
|
|
"""
|
|
|
|
|
)
|
|
|
|
|
graph.refresh_schema()
|
|
|
|
|
|
|
|
|
|
output = graph.query("RETURN range(0,130,1) AS result")
|
|
|
|
|
assert output == [{}]
|
|
|
|
|