Skip to content

Commit

Permalink
adds a simple test for remote s3 datasets
Browse files Browse the repository at this point in the history
Checks the number of files in an example openneuro s3 dataset. Also adds
s3fs as a test dependency.
  • Loading branch information
akhanf committed Oct 26, 2024
1 parent 07bdfcd commit c9f7c1f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
26 changes: 26 additions & 0 deletions bids/layout/tests/test_remote_bids.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
""" Tests runs layout on bids examples and make sure all files are caught"""

""" TODO
- add more 'vanilla' datasets
- missing files in micr?
"""

import pytest

from bids.layout import BIDSLayout

# Values for the number of files by downloading dataset first

@pytest.mark.parametrize(
"dataset, nb_files",
[
("s3://openneuro.org/ds000102", 136),
],
)
def test_layout_on_s3_datasets_no_derivatives(dataset, nb_files):
layout = BIDSLayout(dataset)
files = layout.get()
assert len(files) == nb_files

Check warning on line 23 in bids/layout/tests/test_remote_bids.py

View check run for this annotation

Codecov / codecov/patch

bids/layout/tests/test_remote_bids.py#L22-L23

Added lines #L22 - L23 were not covered by tests



1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ test = [
"coverage[toml]",
"altair",
"pytest-xdist",
"s3fs" #for testing remote uri
]
model_reports = [
"jinja2",
Expand Down

0 comments on commit c9f7c1f

Please sign in to comment.