|
20 | 20 | from models_library.users import UserID |
21 | 21 | from pydantic import ByteSize, TypeAdapter |
22 | 22 | from pytest_simcore.helpers.storage_utils import FileIDDict, ProjectWithFilesParams |
| 23 | +from simcore_service_storage.api._worker_tasks._data_export import data_export |
23 | 24 | from simcore_service_storage.api._worker_tasks._paths import compute_path_size |
24 | 25 | from simcore_service_storage.modules.celery.utils import set_fastapi_app |
25 | 26 | from simcore_service_storage.simcore_s3_dsm import SimcoreS3DataManager |
26 | 27 |
|
27 | | -pytest_simcore_core_services_selection = ["postgres"] |
| 28 | +pytest_simcore_core_services_selection = [ |
| 29 | + "postgres", |
| 30 | + "rabbit", |
| 31 | +] |
28 | 32 | pytest_simcore_ops_services_selection = ["adminer"] |
29 | 33 |
|
30 | 34 | _IsFile: TypeAlias = bool |
@@ -214,3 +218,15 @@ async def test_path_compute_size_inexistent_path( |
214 | 218 | path=Path(faker.file_path(absolute=False)), |
215 | 219 | expected_total_size=0, |
216 | 220 | ) |
| 221 | + |
| 222 | + |
| 223 | +# TODO: refactor and extract common parts |
| 224 | +async def test_data_export( |
| 225 | + fake_celery_task: Task, |
| 226 | + initialized_app: FastAPI, |
| 227 | + client: httpx.AsyncClient, |
| 228 | + user_id: UserID, |
| 229 | +): |
| 230 | + # TODO: fake celery_worker_client as well |
| 231 | + data = await data_export(fake_celery_task, user_id=user_id, paths_to_export=[]) |
| 232 | + assert data == "alskdjalsdjasjkd" |
0 commit comments