Skip to content

Commit

Permalink
add test for scalar name from file name
Browse files Browse the repository at this point in the history
36000 committed Nov 13, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent d6ec46e commit aa6470a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions AFQ/tests/test_definitions.py
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@
from AFQ.definitions.image import * # interprets images from eval
from AFQ.definitions.mapping import * # interprets mappings from eval
from AFQ.tests.test_api import create_dummy_bids_path
from AFQ.definitions.utils import name_from_path


def test_str_instantiates_mixin():
@@ -23,6 +24,15 @@ def test_str_instantiates_mixin():
thresh_image_from_str.upper_bound)


def test_name_from_path():
path = "/data/sub-01/ses-01/dwi/sub-01_ses-01_desc-icvf_dwi.nii.gz"
assert name_from_path(path) == "icvf"
path = "/data/sub-01/ses-01/dwi/sub-01_ses-01_desc-od_dwi.nii.gz"
assert name_from_path(path) == "od"
path = "/data/sub-01/ses-01/anat/sub-01_ses-01_T1w.nii.gz"
assert name_from_path(path) == "T1w"


def test_resample_image():
image_data = np.zeros((2, 2, 2), dtype=bool)
image_data[0] = True

0 comments on commit aa6470a

Please sign in to comment.