From 272965ed618f94ecf0de718bf7e8e0788c4bbb3a Mon Sep 17 00:00:00 2001 From: Laurent LAPORTE Date: Tue, 26 Sep 2023 14:27:34 +0200 Subject: [PATCH] refactoring(data-provider): drop the `DataProvider` class --- antareslauncher/data_repo/data_provider.py | 11 ----------- tests/unit/test_data_provider.py | 17 ----------------- 2 files changed, 28 deletions(-) delete mode 100644 antareslauncher/data_repo/data_provider.py delete mode 100644 tests/unit/test_data_provider.py diff --git a/antareslauncher/data_repo/data_provider.py b/antareslauncher/data_repo/data_provider.py deleted file mode 100644 index f4cd647..0000000 --- a/antareslauncher/data_repo/data_provider.py +++ /dev/null @@ -1,11 +0,0 @@ -from dataclasses import dataclass - -from antareslauncher.data_repo.data_repo_tinydb import DataRepoTinydb - - -@dataclass -class DataProvider: - data_repo: DataRepoTinydb - - def get_list_of_studies(self): - return self.data_repo.get_list_of_studies() diff --git a/tests/unit/test_data_provider.py b/tests/unit/test_data_provider.py deleted file mode 100644 index d2e7067..0000000 --- a/tests/unit/test_data_provider.py +++ /dev/null @@ -1,17 +0,0 @@ -from unittest.mock import Mock - -from antareslauncher.data_repo.data_provider import DataProvider -from antareslauncher.data_repo.data_repo_tinydb import DataRepoTinydb -from antareslauncher.study_dto import StudyDTO - - -def test_data_provider_return_list_of_studies_obtained_from_repo(): - # given - data_repo = Mock(spec_set=DataRepoTinydb) - study = StudyDTO(path="empty_path") - data_repo.get_list_of_studies = Mock(return_value=[study]) - data_provider = DataProvider(data_repo) - # when - list_of_studies = data_provider.get_list_of_studies() - # then - assert list_of_studies == [study]