TEST: Pass config to layout, check both str and Path work
@@ -49,9 +49,13 @@ def test_index_metadata(index_metadata, query, result, mock_config):
-def test_config_filename():
- layout = BIDSLayout(get_test_data_path(),indexer=BIDSLayoutIndexer(config_filename=get_test_data_path()+'/../'+'bids_specs_with_oligarchy.json'),validate=False)
- # make sure that the funny custom config that has every instance of 'session' renamed to 'oligarchy' is respected.
+@pytest.mark.parametrize('config_type', [str, Path])
+def test_config_filename(config_type):
+ data_path = Path(get_test_data_path())
+ # Use custom config that replaces session with oligarchy
+ config_path = data_path.parent / 'bids_specs_with_oligarchy.json'
+ layout = BIDSLayout(data_path / "7t_trt", config=config_type(config_path))
+ # Validate that we are using the desired configuration
assert 'oligarchy' in layout.get_entities()
