Skip to content

Commit

Permalink
Updating graph tests to support new execution plan (#2486)
Browse files Browse the repository at this point in the history
  • Loading branch information
raz-mon committed Dec 6, 2022
1 parent 6fa6cfc commit 6219574
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 19 deletions.
14 changes: 5 additions & 9 deletions tests/test_asyncio/test_graph.py
Expand Up @@ -406,7 +406,7 @@ async def test_execution_plan(modclient: redis.Redis):
"MATCH (r:Rider)-[:rides]->(t:Team) WHERE t.name = $name RETURN r.name, t.name, $params", # noqa
{"name": "Yehuda"},
)
expected = "Results\n Project\n Conditional Traverse | (t:Team)->(r:Rider)\n Filter\n Node By Label Scan | (t:Team)" # noqa
expected = "Results\n Project\n Conditional Traverse | (t)->(r:Rider)\n Filter\n Node By Label Scan | (t:Team)" # noqa
assert result == expected

await redis_graph.delete()
Expand Down Expand Up @@ -437,11 +437,11 @@ async def test_explain(modclient: redis.Redis):
Distinct
Join
Project
Conditional Traverse | (t:Team)->(r:Rider)
Conditional Traverse | (t)->(r:Rider)
Filter
Node By Label Scan | (t:Team)
Project
Conditional Traverse | (t:Team)->(r:Rider)
Conditional Traverse | (t)->(r:Rider)
Filter
Node By Label Scan | (t:Team)"""
assert str(result).replace(" ", "").replace("\n", "") == expected.replace(
Expand All @@ -453,9 +453,7 @@ async def test_explain(modclient: redis.Redis):
Operation("Join")
.append_child(
Operation("Project").append_child(
Operation(
"Conditional Traverse", "(t:Team)->(r:Rider)"
).append_child(
Operation("Conditional Traverse", "(t)->(r:Rider)").append_child(
Operation("Filter").append_child(
Operation("Node By Label Scan", "(t:Team)")
)
Expand All @@ -464,9 +462,7 @@ async def test_explain(modclient: redis.Redis):
)
.append_child(
Operation("Project").append_child(
Operation(
"Conditional Traverse", "(t:Team)->(r:Rider)"
).append_child(
Operation("Conditional Traverse", "(t)->(r:Rider)").append_child(
Operation("Filter").append_child(
Operation("Node By Label Scan", "(t:Team)")
)
Expand Down
14 changes: 5 additions & 9 deletions tests/test_graph.py
Expand Up @@ -497,7 +497,7 @@ def test_execution_plan(client):
"MATCH (r:Rider)-[:rides]->(t:Team) WHERE t.name = $name RETURN r.name, t.name, $params", # noqa
{"name": "Yehuda"},
)
expected = "Results\n Project\n Conditional Traverse | (t:Team)->(r:Rider)\n Filter\n Node By Label Scan | (t:Team)" # noqa
expected = "Results\n Project\n Conditional Traverse | (t)->(r:Rider)\n Filter\n Node By Label Scan | (t:Team)" # noqa
assert result == expected

redis_graph.delete()
Expand Down Expand Up @@ -528,11 +528,11 @@ def test_explain(client):
Distinct
Join
Project
Conditional Traverse | (t:Team)->(r:Rider)
Conditional Traverse | (t)->(r:Rider)
Filter
Node By Label Scan | (t:Team)
Project
Conditional Traverse | (t:Team)->(r:Rider)
Conditional Traverse | (t)->(r:Rider)
Filter
Node By Label Scan | (t:Team)"""
assert str(result).replace(" ", "").replace("\n", "") == expected.replace(
Expand All @@ -544,9 +544,7 @@ def test_explain(client):
Operation("Join")
.append_child(
Operation("Project").append_child(
Operation(
"Conditional Traverse", "(t:Team)->(r:Rider)"
).append_child(
Operation("Conditional Traverse", "(t)->(r:Rider)").append_child(
Operation("Filter").append_child(
Operation("Node By Label Scan", "(t:Team)")
)
Expand All @@ -555,9 +553,7 @@ def test_explain(client):
)
.append_child(
Operation("Project").append_child(
Operation(
"Conditional Traverse", "(t:Team)->(r:Rider)"
).append_child(
Operation("Conditional Traverse", "(t)->(r:Rider)").append_child(
Operation("Filter").append_child(
Operation("Node By Label Scan", "(t:Team)")
)
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Expand Up @@ -94,7 +94,7 @@ volumes =

[docker:redismod]
name = redismod
image = redis/redis-stack-server:latest
image = redislabs/redismod:edge
ports =
36379:6379/tcp
healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',36379)) else False"
Expand Down

0 comments on commit 6219574

Please sign in to comment.