diff --git a/app/tests/dispatch/test_restart_job.py b/app/tests/dispatch/test_restart_job.py index c1e0a5d..9419838 100644 --- a/app/tests/dispatch/test_restart_job.py +++ b/app/tests/dispatch/test_restart_job.py @@ -4,14 +4,14 @@ import unittest import uuid from pathlib import Path -from typing import Callable, Tuple, Dict +from typing import Callable, Tuple, Dict, List import common.config as config import pytest import routing import routing.generate_taskfile from common.constants import mercure_actions, mercure_names -from common.types import * +from common.types import Module, Rule, Config from dispatch.send import execute from docker.models.containers import ContainerCollection # import processor diff --git a/app/tests/dispatch/test_send.py b/app/tests/dispatch/test_send.py index 3e4364c..ee7e45b 100644 --- a/app/tests/dispatch/test_send.py +++ b/app/tests/dispatch/test_send.py @@ -4,6 +4,7 @@ from subprocess import CalledProcessError from unittest.mock import call +import common from common.constants import mercure_names from common.monitor import m_events, severity, task_event from dispatch.send import execute, is_ready_for_sending diff --git a/app/tests/test_integration.py b/app/tests/test_integration.py index a4978d2..9b79dee 100644 --- a/app/tests/test_integration.py +++ b/app/tests/test_integration.py @@ -3,7 +3,9 @@ import pytest from common.types import FolderTarget, Module, Rule +from testing_integration_common import send_dicom, is_dicoms_in_folder, is_dicoms_received, is_series_registered from testing_integration_common import * + from tests.testing_common import create_minimal_dicom diff --git a/app/tests/test_notifications.py b/app/tests/test_notifications.py index 5dc91c7..bd8746b 100644 --- a/app/tests/test_notifications.py +++ b/app/tests/test_notifications.py @@ -5,19 +5,21 @@ from collections.abc import Iterable from itertools import product from pathlib import Path -from typing import Callable, Iterator, Dict +from typing import Callable, Iterator, Dict, Any, List from unittest.mock import call import pytest from common import notification from common.constants import mercure_events -from common.types import * +from common.types import Module, Rule, Config from dispatch import dispatcher from docker.models.containers import ContainerCollection from process import processor from pytest_mock import MockerFixture from routing import router +from testing_common import make_fake_processor, FakeDockerContainer, mock_incoming_uid from testing_common import * +from common import config logger = config.get_logger() diff --git a/app/tests/test_processor.py b/app/tests/test_processor.py index e3b187d..7a5c501 100644 --- a/app/tests/test_processor.py +++ b/app/tests/test_processor.py @@ -19,7 +19,7 @@ import routing.generate_taskfile from common.constants import mercure_names, mercure_version from common.monitor import task_event -from common.types import * +from common.types import Dict, Config, Module, Rule, Task, TaskProcessing, List from docker.models.containers import ContainerCollection from docker.models.images import ImageCollection from nomad.api.job import Job @@ -28,7 +28,8 @@ from pytest_mock import MockerFixture from routing import router from testing_common import * -from testing_common import mock_task_ids +from testing_common import mock_task_ids, FakeDockerContainer, FakeImageContainer, make_fake_processor, mock_incoming_uid +from common import config logger = config.get_logger() diff --git a/app/tests/test_router.py b/app/tests/test_router.py index dba6382..13009fe 100644 --- a/app/tests/test_router.py +++ b/app/tests/test_router.py @@ -6,6 +6,7 @@ import os import unittest import uuid + from pathlib import Path from typing import Tuple from unittest.mock import call @@ -13,12 +14,12 @@ import common import routing.generate_taskfile from common.monitor import m_events, severity, task_event -from common.types import * +from common.types import Rule, Task, TaskStudy from dispatch import dispatcher from pyfakefs.fake_filesystem import FakeFilesystem from routing import router from testing_common import * -from testing_common import mock_task_ids +from testing_common import mock_task_ids, generate_uid, mock_incoming_uid, process_dicom # import common.config as config diff --git a/app/tests/test_studies.py b/app/tests/test_studies.py index 62bf664..67a1fb3 100644 --- a/app/tests/test_studies.py +++ b/app/tests/test_studies.py @@ -1,6 +1,8 @@ import asyncio import unittest import uuid +import shutil + from datetime import timedelta from pathlib import Path from typing import Tuple @@ -8,12 +10,13 @@ import pytest from common import notification from common.constants import mercure_events, mercure_names -from common.types import * +from common.types import Rule, Module from freezegun import freeze_time from nomad.api.job import Job from process import processor from pyfakefs.fake_filesystem import FakeFilesystem from routing import router +from testing_common import mock_incoming_uid from testing_common import *