Skip to content

Commit

Permalink
Add test for exclude flag
Browse files Browse the repository at this point in the history
  • Loading branch information
e-kenneally authored Jun 22, 2024
1 parent af24883 commit 194e212
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/test_bids2table.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,19 @@ def test_bids2table_nonexist(tmp_path: Path):
with pytest.raises(FileNotFoundError):
bids2table(root=tmp_path / "nonexistent_dataset")

def test_bids2table_exclude(tmp_path: Path):
root = BIDS_EXAMPLES / "ds001"
index_path = tmp_path / "index_exclude.b2t"
exclude_list = ["sub-01", "sub-02"]

tab = bids2table(
root=root, with_meta=True, persistent=True, index_path=index_path, exclude=exclude_list
)

# Check that the excluded strings are not in the indexed table
for excluded in exclude_list:
assert excluded not in tab['ent__sub'].values


if __name__ == "__main__":
pytest.main([__file__])

0 comments on commit 194e212

Please sign in to comment.