Skip to content

Commit

Permalink
Updated methods descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Kolea Plesco committed Apr 27, 2022
1 parent 906acee commit 2fd98c4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions ted_sws/data_manager/adapters/mapping_suite_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,13 @@ def _write_file_resources(self, file_resources: List[FileResource], path: pathli

@classmethod
def _guess_test_data_file_name(cls, file, parent=None) -> str:
"""
This method generates (guesses) a file_name for a file-type resource, based on file's original_name and
parent folder (grouping) name.
:param file:
:param parent:
:return:
"""
mapping_suite_name = file
if parent and parent != TEST_DATA_PACKAGE_NAME:
parts = parent.split('_')
Expand All @@ -179,6 +186,14 @@ def _guess_test_data_file_name(cls, file, parent=None) -> str:
return mapping_suite_name

def _read_test_data_file_resources(self, path: pathlib.Path, file_resources=None) -> List[FileResource]:
"""
This method reads a folder (with nested-tree structure) of resources and returns a flat list of file-type
resources from all beyond levels.
Used for folders that contains files with unique names, but grouped into sub-folders.
:param path:
:param file_resources:
:return:
"""
if file_resources is None:
file_resources = []

Expand Down

0 comments on commit 2fd98c4

Please sign in to comment.