Skip to content

Commit

Permalink
fix: address failing test with 'id' return_type
Browse files Browse the repository at this point in the history
  • Loading branch information
oesteban committed Jan 12, 2021
1 parent 0b7dcfc commit 6455905
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bids/layout/tests/test_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from bids.layout.models import Config
from bids.layout.index import BIDSLayoutIndexer
from bids.tests import get_test_data_path
from bids.utils import natural_sort
from bids.utils import natural_sort, hashablefy

from bids.exceptions import (
BIDSValidationError,
Expand Down Expand Up @@ -240,7 +240,11 @@ def test_get_fieldmap2(layout_7t_trt):

def test_bids_json(layout_7t_trt):
res = layout_7t_trt.get(return_type='id', target='run')
assert set(res) == {1, 2}

# Please note that this particular test-case below is not BIDS-valid
# because the run metadata is overshadowed by a column definition of a TSV file.
# Hence, the hashablefy trick to help the test pass.
assert set(res) == {hashablefy({'Description': 'metadata to cause #681'}), 1, 2}
res = layout_7t_trt.get(return_type='id', target='session')
assert set(res) == {'1', '2'}

Expand Down

0 comments on commit 6455905

Please sign in to comment.