Skip to content

Commit

Permalink
Ignore surrounding quotes of exclude/include pattern in assert.
Browse files Browse the repository at this point in the history
  • Loading branch information
ellendejong committed Dec 30, 2024
1 parent 9ca926b commit 04b553b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions test_rsync_to_rdisc.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,9 @@ def test_rsync_ok(self, set_up_test, mocker, mock_send_mail_transfer_state):
"key,value",
[
("include", ["single_sample_vcf/"]),
# ("include", ["single_sample_vcf/", "QC/"]),
# ("exclude", ["exomedepth/*"]),
# ("exclude", ["exomedepth/*", "QC/*"]),
("include", ["single_sample_vcf/", "QC/"]),
("exclude", ["exomedepth/*"]),
("exclude", ["exomedepth/*", "QC/*"]),
],
)
def test_rsync_ok_include_exclude(self, key, value, set_up_test, mocker, mock_send_mail_transfer_state):
Expand Down Expand Up @@ -387,7 +387,11 @@ def test_rsync_ok_include_exclude(self, key, value, set_up_test, mocker, mock_se
# Assert that each include/exclude is accompanied with a value.
for idx, rsync_part in enumerate(split_rsync_call):
if rsync_part == f"--{key}":
assert split_rsync_call[idx + 1] in value
pattern = split_rsync_call[idx + 1]
# Ignore surrounding quotes.
assert pattern.replace("'", "") in value
# Assert pattern is surrounded by quotes.
assert pattern.startswith("'") and pattern.endswith("'")

def test_rsync_error(self, set_up_test, mocker, mock_send_mail_transfer_state):
mocker.patch("rsync_to_rdisc.check_if_file_missing", return_value=[])
Expand Down

0 comments on commit 04b553b

Please sign in to comment.