Skip to content

Commit

Permalink
Minor test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelzwiers committed Feb 7, 2024
1 parent 4cd8017 commit 1121e59
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/test_bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,17 +159,19 @@ def test_get_dicomfield(dcm_file_csa):


@pytest.mark.parametrize('template', bcoin.list_plugins()[1])
def test_load_check_template(template):
def test_load_check_template(template: dict):

dataformat = list(template.keys())[0]

# Load a valid template
bidsmap, _ = bids.load_bidsmap(template, checks=(False, False, False))
assert isinstance(bidsmap, dict) and bidsmap
assert bids.check_template(bidsmap) is True

# Add an invalid data type
bidsmap['DICOM']['foo'] = bidsmap['DICOM']['extra_data']
bidsmap[dataformat]['foo'] = bidsmap['DICOM']['extra_data']
assert bids.check_template(bidsmap) is False
del bidsmap['DICOM']['foo']
del bidsmap[dataformat]['foo']

# Remove a valid suffix (BIDS-entity)
bidsmap['DICOM']['anat'].pop(-2) # NB: Assumes CT is the last item, MTR the second last
Expand Down

0 comments on commit 1121e59

Please sign in to comment.