6
6
from unittest .mock import Mock
7
7
8
8
import pytest
9
- from exasol_bucketfs_utils_python .localfs_mock_bucketfs_location import (
10
- LocalFSMockBucketFSLocation ,
11
- )
9
+ import exasol .bucketfs as bfs
12
10
13
11
from exasol .analytics .query_handler .context .scope import ScopeQueryHandlerContext
14
12
from exasol .analytics .query_handler .context .top_level_query_handler_context import (
@@ -224,14 +222,12 @@ def create_test_setup(
224
222
sql_stage_graph : SQLStageGraph ,
225
223
stages : List [TestSQLStage ],
226
224
context : TopLevelQueryHandlerContext ,
227
- local_fs_mock_bucket_fs_tmp_path : PurePosixPath ,
225
+ bucketfs_location : bfs . path . PathLike ,
228
226
) -> TestSetup :
229
227
stage_input_output = create_input ()
230
228
parameter = SQLStageGraphExecutionInput (
231
229
sql_stage_graph = sql_stage_graph ,
232
- result_bucketfs_location = LocalFSMockBucketFSLocation (
233
- local_fs_mock_bucket_fs_tmp_path
234
- ),
230
+ result_bucketfs_location = bucketfs_location ,
235
231
input = stage_input_output ,
236
232
)
237
233
child_query_handler_context = context .get_child_query_handler_context ()
@@ -247,7 +243,8 @@ def create_test_setup(
247
243
248
244
249
245
def test_start_with_single_stage_with_start_only_forward_query_handler (
250
- top_level_query_handler_context_mock , tmp_path
246
+ top_level_query_handler_context_mock ,
247
+ mocked_temporary_bucketfs_location ,
251
248
):
252
249
"""
253
250
This test runs an integration test for the start method of a SQLStageGraphExecutionQueryHandler
@@ -270,7 +267,7 @@ def arrange() -> TestSetup:
270
267
sql_stage_graph = sql_stage_graph ,
271
268
stages = [stage1 ],
272
269
context = top_level_query_handler_context_mock ,
273
- local_fs_mock_bucket_fs_tmp_path = PurePosixPath ( tmp_path ) ,
270
+ bucketfs_location = mocked_temporary_bucketfs_location ,
274
271
)
275
272
return test_setup
276
273
@@ -297,7 +294,8 @@ def act(test_setup: TestSetup) -> Union[Continue, Finish[SQLStageInputOutput]]:
297
294
298
295
299
296
def test_start_with_two_stages_with_start_only_forward_query_handler (
300
- top_level_query_handler_context_mock , tmp_path
297
+ top_level_query_handler_context_mock ,
298
+ mocked_temporary_bucketfs_location ,
301
299
):
302
300
"""
303
301
This test runs an integration test for the start method of a SQLStageGraphExecutionQueryHandler
@@ -326,7 +324,7 @@ def arrange() -> TestSetup:
326
324
sql_stage_graph = sql_stage_graph ,
327
325
stages = [stage1 , stage2 ],
328
326
context = top_level_query_handler_context_mock ,
329
- local_fs_mock_bucket_fs_tmp_path = PurePosixPath ( tmp_path ) ,
327
+ bucketfs_location = mocked_temporary_bucketfs_location ,
330
328
)
331
329
return test_setup
332
330
@@ -361,7 +359,8 @@ def not_raises(exception):
361
359
362
360
363
361
def test_start_with_single_stage_with_start_only_create_new_output_query_handler (
364
- top_level_query_handler_context_mock , tmp_path
362
+ top_level_query_handler_context_mock ,
363
+ mocked_temporary_bucketfs_location ,
365
364
):
366
365
"""
367
366
This test runs an integration test for the start method of a SQLStageGraphExecutionQueryHandler
@@ -386,7 +385,7 @@ def arrange() -> TestSetup:
386
385
sql_stage_graph = sql_stage_graph ,
387
386
stages = [stage1 ],
388
387
context = top_level_query_handler_context_mock ,
389
- local_fs_mock_bucket_fs_tmp_path = PurePosixPath ( tmp_path ) ,
388
+ bucketfs_location = mocked_temporary_bucketfs_location ,
390
389
)
391
390
return test_setup
392
391
@@ -426,7 +425,8 @@ def act(test_setup: TestSetup) -> Union[Continue, Finish[SQLStageInputOutput]]:
426
425
427
426
428
427
def test_start_with_two_stages_with_start_only_create_new_output_query_handler (
429
- top_level_query_handler_context_mock , tmp_path
428
+ top_level_query_handler_context_mock ,
429
+ mocked_temporary_bucketfs_location ,
430
430
):
431
431
"""
432
432
This test runs an integration test for the start method of a SQLStageGraphExecutionQueryHandler
@@ -457,7 +457,7 @@ def arrange() -> TestSetup:
457
457
sql_stage_graph = sql_stage_graph ,
458
458
stages = [stage1 , stage2 ],
459
459
context = top_level_query_handler_context_mock ,
460
- local_fs_mock_bucket_fs_tmp_path = PurePosixPath ( tmp_path ) ,
460
+ bucketfs_location = mocked_temporary_bucketfs_location ,
461
461
)
462
462
return test_setup
463
463
@@ -501,7 +501,8 @@ def act(test_setup: TestSetup) -> Union[Continue, Finish[SQLStageInputOutput]]:
501
501
502
502
503
503
def test_start_with_single_stage_with_handle_query_result_create_new_output_query_handler_part1 (
504
- top_level_query_handler_context_mock , tmp_path
504
+ top_level_query_handler_context_mock ,
505
+ mocked_temporary_bucketfs_location ,
505
506
):
506
507
"""
507
508
This test runs an integration test for the start method of a SQLStageGraphExecutionQueryHandler
@@ -523,7 +524,7 @@ def arrange() -> TestSetup:
523
524
sql_stage_graph = sql_stage_graph ,
524
525
stages = [stage1 ],
525
526
context = top_level_query_handler_context_mock ,
526
- local_fs_mock_bucket_fs_tmp_path = PurePosixPath ( tmp_path ) ,
527
+ bucketfs_location = mocked_temporary_bucketfs_location ,
527
528
)
528
529
return test_setup
529
530
@@ -549,7 +550,8 @@ def act(test_setup: TestSetup) -> Union[Continue, Finish[SQLStageInputOutput]]:
549
550
550
551
551
552
def test_handle_query_result_with_single_stage_with_handle_query_result_create_new_output_query_handler_part2 (
552
- top_level_query_handler_context_mock , tmp_path
553
+ top_level_query_handler_context_mock ,
554
+ mocked_temporary_bucketfs_location ,
553
555
):
554
556
"""
555
557
This test uses test_start_with_single_stage_with_handle_query_result_create_new_output_query_handler_part1
@@ -574,7 +576,7 @@ def arrange() -> Tuple[TestSetup, QueryResult]:
574
576
sql_stage_graph = sql_stage_graph ,
575
577
stages = [stage1 ],
576
578
context = top_level_query_handler_context_mock ,
577
- local_fs_mock_bucket_fs_tmp_path = PurePosixPath ( tmp_path ) ,
579
+ bucketfs_location = mocked_temporary_bucketfs_location ,
578
580
)
579
581
test_setup .query_handler .start ()
580
582
query_result : QueryResult = Mock ()
0 commit comments