Skip to content

Commit c849a66

Browse files
committed
Fix mocked result of cypher query
the result is in a single column and squeeze returns the dict
1 parent 031dc83 commit c849a66

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

graphdatascience/tests/unit/test_graph_cypher.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
@pytest.mark.parametrize("server_version", [ServerVersion(2, 4, 0)])
1111
def test_simple(runner: CollectingQueryRunner, gds: GraphDataScience) -> None:
12-
runner.set__mock_result(DataFrame([{"graphName": "g", "don't squeeze": "me now"}]))
12+
runner.set__mock_result(DataFrame([[{"graphName": "g", "don't squeeze": "me now"}]]))
1313

1414
G, _ = gds.graph.cypher.project("MATCH (s)-->(t) RETURN gds.graph.project('g', s, t)")
1515

@@ -21,7 +21,7 @@ def test_simple(runner: CollectingQueryRunner, gds: GraphDataScience) -> None:
2121

2222
@pytest.mark.parametrize("server_version", [ServerVersion(2, 4, 0)])
2323
def test_fstring(runner: CollectingQueryRunner, gds: GraphDataScience) -> None:
24-
runner.set__mock_result(DataFrame([{"graphName": "g", "don't squeeze": "me now"}]))
24+
runner.set__mock_result(DataFrame([[{"graphName": "g", "don't squeeze": "me now"}]]))
2525

2626
graph_name = "g"
2727
G, _ = gds.graph.cypher.project(f"MATCH (s)-->(t) RETURN gds.graph.project('{graph_name}', s, t)")
@@ -34,7 +34,7 @@ def test_fstring(runner: CollectingQueryRunner, gds: GraphDataScience) -> None:
3434

3535
@pytest.mark.parametrize("server_version", [ServerVersion(2, 4, 0)])
3636
def test_expression(runner: CollectingQueryRunner, gds: GraphDataScience) -> None:
37-
runner.set__mock_result(DataFrame([{"graphName": "gg", "don't squeeze": "me now"}]))
37+
runner.set__mock_result(DataFrame([[{"graphName": "gg", "don't squeeze": "me now"}]]))
3838

3939
G, _ = gds.graph.cypher.project("WITH 'g' AS suffix MATCH (s)-->(t) RETURN gds.graph.project('g' + suffix, s, t)")
4040

@@ -46,7 +46,7 @@ def test_expression(runner: CollectingQueryRunner, gds: GraphDataScience) -> Non
4646

4747
@pytest.mark.parametrize("server_version", [ServerVersion(2, 4, 0)])
4848
def test_with_parameter(runner: CollectingQueryRunner, gds: GraphDataScience) -> None:
49-
runner.set__mock_result(DataFrame([{"graphName": "g", "don't squeeze": "me now"}]))
49+
runner.set__mock_result(DataFrame([[{"graphName": "g", "don't squeeze": "me now"}]]))
5050

5151
G, _ = gds.graph.cypher.project("MATCH (s)-->(t) RETURN gds.graph.project($the_graph, s, t)", the_graph="g")
5252

@@ -58,7 +58,7 @@ def test_with_parameter(runner: CollectingQueryRunner, gds: GraphDataScience) ->
5858

5959
@pytest.mark.parametrize("server_version", [ServerVersion(2, 4, 0)])
6060
def test_with_lots_of_whitespace(runner: CollectingQueryRunner, gds: GraphDataScience) -> None:
61-
runner.set__mock_result(DataFrame([{"graphName": "g", "don't squeeze": "me now"}]))
61+
runner.set__mock_result(DataFrame([[{"graphName": "g", "don't squeeze": "me now"}]]))
6262

6363
G, _ = gds.graph.cypher.project("MATCH (s)-->(t) RETURN gds .graph. project\n(\t'g' ,s, t)")
6464

@@ -70,7 +70,7 @@ def test_with_lots_of_whitespace(runner: CollectingQueryRunner, gds: GraphDataSc
7070

7171
@pytest.mark.parametrize("server_version", [ServerVersion(2, 4, 0)])
7272
def test_extracting_graph_name(runner: CollectingQueryRunner, gds: GraphDataScience) -> None:
73-
runner.set__mock_result(DataFrame([{"graphName": "the graph", "don't squeeze": "me now"}]))
73+
runner.set__mock_result(DataFrame([[{"graphName": "the graph", "don't squeeze": "me now"}]]))
7474

7575
G, _ = gds.graph.cypher.project("MATCH (s)-->(t) RETURN gds.graph.project('g', s, t)")
7676

0 commit comments

Comments
 (0)