Skip to content

Commit

Permalink
feat: adding config.DatasetInfoGenerator
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe committed Jul 22, 2024
1 parent cdd5b7e commit f747e98
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/tests/test_config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import syrupy

from varfish_installer.config import DownloadConfig, ManifestParser
from varfish_installer.config import DownloadConfig, ManifestParser, DownloadInfoGenerator

#: Default configuration to use.
DEFAULT_CONFIG = DownloadConfig()
Expand All @@ -10,3 +10,11 @@ def test_manifest_parser(snapshot: syrupy.assertion.SnapshotAssertion):
parser = ManifestParser(path="tests/config/manifest-gnomad-exomes.txt")
result = parser.parse()
assert result == snapshot


def test_download_info_generator(snapshot: syrupy.assertion.SnapshotAssertion):
parser = ManifestParser(path="tests/config/manifest-gnomad-exomes.txt")
manifest = parser.parse()
config = DownloadConfig(datasets=[manifest])
result = manifest
assert result == snapshot
8 changes: 8 additions & 0 deletions src/varfish_installer/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,3 +261,11 @@ class DownloadConfig(BaseConfig):

#: The datasets to download, empty list for all.
datasets: list[DownloadDataset] = []


class DatasetInfoGenerator:
"""Helper class to load dataset information."""

def __init__(self, config: DownloadConfig):
#: Configuration to use.
self.config = config

0 comments on commit f747e98

Please sign in to comment.