1313from typing import Any
1414from unittest import mock
1515
16- import aiopg
17- import aiopg .sa
1816import pytest
1917from _helpers import PublishedProject , set_comp_task_inputs , set_comp_task_outputs
2018from dask_task_models_library .container_tasks .io import (
@@ -244,7 +242,7 @@ def fake_task_output_data(
244242
245243
246244async def test_parse_output_data (
247- aiopg_engine : aiopg . sa . engine . Engine ,
245+ sqlalchemy_async_engine : AsyncEngine ,
248246 published_project : PublishedProject ,
249247 user_id : UserID ,
250248 fake_io_schema : dict [str , dict [str , str ]],
@@ -255,7 +253,7 @@ async def test_parse_output_data(
255253 sleeper_task : CompTaskAtDB = published_project .tasks [1 ]
256254 no_outputs = {}
257255 await set_comp_task_outputs (
258- aiopg_engine , sleeper_task .node_id , fake_io_schema , no_outputs
256+ sqlalchemy_async_engine , sleeper_task .node_id , fake_io_schema , no_outputs
259257 )
260258 # mock the set_value function so we can test it is called correctly
261259 mocked_node_ports_set_value_fct = mocker .patch (
@@ -270,7 +268,7 @@ async def test_parse_output_data(
270268 published_project .project .uuid ,
271269 sleeper_task .node_id ,
272270 )
273- await parse_output_data (aiopg_engine , dask_job_id , fake_task_output_data )
271+ await parse_output_data (sqlalchemy_async_engine , dask_job_id , fake_task_output_data )
274272
275273 # the FileUrl types are converted to a pure url
276274 expected_values = {
@@ -299,7 +297,6 @@ def _app_config_with_db(
299297
300298async def test_compute_input_data (
301299 _app_config_with_db : None ,
302- aiopg_engine : aiopg .sa .engine .Engine ,
303300 sqlalchemy_async_engine : AsyncEngine ,
304301 initialized_app : FastAPI ,
305302 user_id : UserID ,
@@ -330,7 +327,7 @@ async def test_compute_input_data(
330327 for key , value_type in fake_io_schema .items ()
331328 }
332329 await set_comp_task_inputs (
333- aiopg_engine , sleeper_task .node_id , fake_io_schema , fake_inputs
330+ sqlalchemy_async_engine , sleeper_task .node_id , fake_io_schema , fake_inputs
334331 )
335332
336333 # mock the get_value function so we can test it is called correctly
@@ -378,7 +375,6 @@ def tasks_file_link_scheme(tasks_file_link_type: FileLinkType) -> tuple:
378375
379376async def test_compute_output_data_schema (
380377 _app_config_with_db : None ,
381- aiopg_engine : aiopg .sa .engine .Engine ,
382378 sqlalchemy_async_engine : AsyncEngine ,
383379 initialized_app : FastAPI ,
384380 user_id : UserID ,
@@ -392,7 +388,7 @@ async def test_compute_output_data_schema(
392388 # simulate pre-created file links
393389 no_outputs = {}
394390 await set_comp_task_outputs (
395- aiopg_engine , sleeper_task .node_id , fake_io_schema , no_outputs
391+ sqlalchemy_async_engine , sleeper_task .node_id , fake_io_schema , no_outputs
396392 )
397393
398394 node_ports = await create_node_ports (
@@ -428,7 +424,7 @@ async def test_compute_output_data_schema(
428424
429425@pytest .mark .parametrize ("entry_exists_returns" , [True , False ])
430426async def test_clean_task_output_and_log_files_if_invalid (
431- aiopg_engine : aiopg . sa . engine . Engine ,
427+ sqlalchemy_async_engine : AsyncEngine ,
432428 user_id : UserID ,
433429 published_project : PublishedProject ,
434430 mocked_node_ports_filemanager_fcts : dict [str , mock .MagicMock ],
@@ -459,11 +455,11 @@ async def test_clean_task_output_and_log_files_if_invalid(
459455 if value_type ["type" ] == "data:*/*"
460456 }
461457 await set_comp_task_outputs (
462- aiopg_engine , sleeper_task .node_id , fake_io_schema , fake_outputs
458+ sqlalchemy_async_engine , sleeper_task .node_id , fake_io_schema , fake_outputs
463459 )
464460 # this should ask for the 2 files + the log file
465461 await clean_task_output_and_log_files_if_invalid (
466- aiopg_engine ,
462+ sqlalchemy_async_engine ,
467463 user_id ,
468464 published_project .project .uuid ,
469465 published_project .tasks [1 ].node_id ,
0 commit comments