add test for failed path building
@@ -25,3 +25,9 @@ def test_invalid_file_construction(layout):
target = "sub-01/func/sub-01_task-resting-state_run-1_bold.nii.gz"
assert layout.build_path(ents, validate=False) == target
+
+
+def test_failed_file_construction(layout):
+ ents = dict(subject='01', fakekey='foobar')
+ with pytest.raises(ValueError):
+ layout.build_path(ents)
