Skip to content

Commit

Permalink
Fix test.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo committed Dec 8, 2020
1 parent 5970b78 commit b1a3e53
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions heudiconv/tests/test_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

def test_update_complex_name():
"""Unit testing for heudiconv.convert.update_complex_name(), which updates
filenames with the rec field if appropriate.
filenames with the part field if appropriate.
"""
# Standard name update
fn = 'sub-X_ses-Y_task-Z_run-01_sbref'
Expand All @@ -26,12 +26,12 @@ def test_update_complex_name():
# Data type is missing from metadata so use suffix
fn = 'sub-X_ses-Y_task-Z_run-01_sbref'
metadata = {'ImageType': ['ORIGINAL', 'PRIMARY', 'MB', 'TE3', 'ND', 'MOSAIC']}
out_fn_true = 'sub-X_ses-Y_task-Z_run-01_rec-3_sbref'
out_fn_true = 'sub-X_ses-Y_task-Z_run-01_part-3_sbref'
out_fn_test = update_complex_name(metadata, fn, suffix)
assert out_fn_test == out_fn_true
# Catch existing field with value that *does not match* metadata
# and raise Exception
fn = 'sub-X_ses-Y_task-Z_run-01_rec-mag_sbref'
fn = 'sub-X_ses-Y_task-Z_run-01_part-mag_sbref'
metadata = {'ImageType': ['ORIGINAL', 'PRIMARY', 'P', 'MB', 'TE3', 'ND', 'MOSAIC']}
suffix = 3
with pytest.raises(BIDSError):
Expand Down

0 comments on commit b1a3e53

Please sign in to comment.