Skip to content

Commit

Permalink
update mock test
Browse files Browse the repository at this point in the history
  • Loading branch information
GiaJordan committed Nov 20, 2024
1 parent dd9d6a9 commit 800a4cd
Showing 1 changed file with 11 additions and 40 deletions.
51 changes: 11 additions & 40 deletions tests/integration/test_store_synapse.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,19 +276,16 @@ def test_get_files_in_storage_dataset(
assert synapse_id_regex.fullmatch(dataset_files[0][0])

@pytest.mark.parametrize(
"asset_view, dataset_id, expected_files, mock_walk_return",
"asset_view, dataset_id, expected_files",
[
(
"syn23643253",
"syn61374924",
[
("syn61374926", "schematic - main/BulkRNASeq and files/txt1.txt"),
("syn61374930", "schematic - main/BulkRNASeq and files/txt2.txt"),
("syn62282720", "schematic - main/BulkRNASeq and files/txt4.txt"),
("syn62282794", "schematic - main/BulkRNASeq and files/txt3.txt"),
],
[
(("BulkRNASeq and files", "syn61374924"), [], []),
("syn62282720", "schematic - main/BulkRNASeq and files/txt4.txt"),
],
),
(
Expand All @@ -308,18 +305,11 @@ def test_get_files_in_storage_dataset(
"schematic - main/TestDatasets/TestDataset-Annotations-v3/Sample_C.txt",
),
],
[
(("TestDataset-Annotations-v3", "syn25614635"), [], []),
],
),
(
"syn63917487",
"syn63917494",
[
(
"syn63917518",
"schematic - main/Test files and dataset annotations/Test BulkRNAseq w annotation/txt4.txt",
),
(
"syn63917520",
"schematic - main/Test files and dataset annotations/Test BulkRNAseq w annotation/txt1.txt",
Expand All @@ -332,19 +322,16 @@ def test_get_files_in_storage_dataset(
"syn63917522",
"schematic - main/Test files and dataset annotations/Test BulkRNAseq w annotation/txt3.txt",
),
],
[
(("Test BulkRNAseq w annotation", "syn63917494"), [], []),
(
"syn63917518",
"schematic - main/Test files and dataset annotations/Test BulkRNAseq w annotation/txt4.txt",
),
],
),
(
"syn23643253",
"syn63927665",
[
(
"syn63927670",
"schematic - main/BulkRNAseq nested files/data/txt4.txt",
),
(
"syn63927671",
"schematic - main/BulkRNAseq nested files/data/txt1.txt",
Expand All @@ -357,24 +344,16 @@ def test_get_files_in_storage_dataset(
"syn63927673",
"schematic - main/BulkRNAseq nested files/data/txt3.txt",
),
],
[
(
("BulkRNAseq nested files", "syn63927665"),
[("data", "syn63927667")],
[],
"syn63927670",
"schematic - main/BulkRNAseq nested files/data/txt4.txt",
),
(("BulkRNAseq nested files/data", "syn63927667"), [], []),
],
),
(
"syn23643253",
"syn63987067",
[
(
"syn63987071",
"schematic - main/BulkRNAseq and double nested files/dataset/folder 1/data/txt4.txt",
),
(
"syn63987072",
"schematic - main/BulkRNAseq and double nested files/dataset/folder 1/data/txt1.txt",
Expand All @@ -387,15 +366,10 @@ def test_get_files_in_storage_dataset(
"syn63987074",
"schematic - main/BulkRNAseq and double nested files/dataset/folder 1/data/txt3.txt",
),
],
[
(("dataset", "syn63987067"), [("folder 1", "syn63987068")], []),
(
("dataset/folder 1", "syn63987068"),
[("data", "syn63987069")],
[],
"syn63987071",
"schematic - main/BulkRNAseq and double nested files/dataset/folder 1/data/txt4.txt",
),
(("dataset/folder 1/data", "syn63987069"), [], []),
],
),
],
Expand All @@ -419,16 +393,13 @@ def test_mock_get_files_in_storage_dataset(
asset_view,
dataset_id,
expected_files,
mock_walk_return,
):
# GIVEN a test configuration
TEST_CONFIG = Configuration()

with patch(
"schematic.store.synapse.CONFIG", return_value=TEST_CONFIG
) as mock_config, patch(
"synapseutils.walk_functions._help_walk", return_value=mock_walk_return
) as mock_walk_patch:
) as mock_config:
with patch.object(synapse_store, "syn") as mock_synapse_client:
# AND the appropriate asset view
mock_config.synapse_master_fileview_id = asset_view
Expand Down

0 comments on commit 800a4cd

Please sign in to comment.