|
3 | 3 | from nodestream_plugin_neo4j.query import (
|
4 | 4 | APOC_BATCH_QUERY_RESPONSE_FIELDS,
|
5 | 5 | COMMIT_QUERY,
|
6 |
| - NON_APOCH_COMMIT_QUERY, |
| 6 | + NON_APOC_COMMIT_QUERY, |
7 | 7 | RETURN_CLAUSE,
|
8 | 8 | UNWIND_QUERY,
|
9 | 9 | YIELD_CLAUSE,
|
@@ -59,23 +59,13 @@ def test_apoc_batch_response_default_initialization():
|
59 | 59 | assert_that(response.updateStatistics, is_(ApocUpdateStatistics))
|
60 | 60 |
|
61 | 61 |
|
62 |
| -def test_apoc_batch_response_post_init_with_none_values(): |
63 |
| - response = ApocBatchResponse(batches=5, errorMessages=None, updateStatistics=None) |
64 |
| - # __post_init__ should initialize these to defaults |
65 |
| - assert_that(response.errorMessages, equal_to({})) |
66 |
| - assert_that(response.updateStatistics, not_none()) |
67 |
| - assert_that(response.updateStatistics, is_(ApocUpdateStatistics)) |
68 |
| - assert_that(response.batches, equal_to(5)) |
69 |
| - |
70 |
| - |
71 | 62 | def test_apoc_batch_response_post_init_with_existing_values():
|
72 | 63 | existing_errors = {"error1": "message1"}
|
73 | 64 | existing_stats = ApocUpdateStatistics(nodesCreated=10)
|
74 | 65 |
|
75 | 66 | response = ApocBatchResponse(
|
76 | 67 | errorMessages=existing_errors, updateStatistics=existing_stats
|
77 | 68 | )
|
78 |
| - # __post_init__ should not overwrite existing values |
79 | 69 | assert_that(response.errorMessages, equal_to(existing_errors))
|
80 | 70 | assert_that(response.updateStatistics, equal_to(existing_stats))
|
81 | 71 | assert_that(response.updateStatistics.nodesCreated, equal_to(10))
|
@@ -228,7 +218,7 @@ def test_query_batch_as_query_with_apoc_iterate_false():
|
228 | 218 |
|
229 | 219 | result = batch.as_query(apoc_iterate=False)
|
230 | 220 |
|
231 |
| - assert_that(result.query_statement, equal_to(NON_APOCH_COMMIT_QUERY)) |
| 221 | + assert_that(result.query_statement, equal_to(NON_APOC_COMMIT_QUERY)) |
232 | 222 | assert_that(result.is_apoc, equal_to(False))
|
233 | 223 | assert_that(
|
234 | 224 | result.parameters,
|
@@ -308,6 +298,6 @@ def test_commit_query_structure():
|
308 | 298 |
|
309 | 299 |
|
310 | 300 | def test_non_apoc_commit_query_structure():
|
311 |
| - assert_that("UNWIND" in NON_APOCH_COMMIT_QUERY, equal_to(True)) |
312 |
| - assert_that("CALL apoc.cypher.doIt" in NON_APOCH_COMMIT_QUERY, equal_to(True)) |
313 |
| - assert_that("RETURN" in NON_APOCH_COMMIT_QUERY, equal_to(True)) |
| 301 | + assert_that("UNWIND" in NON_APOC_COMMIT_QUERY, equal_to(True)) |
| 302 | + assert_that("CALL apoc.cypher.doIt" in NON_APOC_COMMIT_QUERY, equal_to(True)) |
| 303 | + assert_that("RETURN" in NON_APOC_COMMIT_QUERY, equal_to(True)) |
0 commit comments