Skip to content

Commit

Permalink
enh: expand test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
oesteban committed Aug 1, 2024
1 parent 8ba34c9 commit ed1ffc8
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion nitransforms/tests/test_resampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from nitransforms import nonlinear as nitnl
from nitransforms import manip as nitm
from nitransforms import io
from nitransforms.resampling import apply
from nitransforms.resampling import apply, _apply_volume

RMSE_TOL_LINEAR = 0.09
RMSE_TOL_NONLINEAR = 0.05
Expand Down Expand Up @@ -363,3 +363,16 @@ def test_LinearTransformsMapping_apply(
reference=testdata_path / "sbref.nii.gz",
serialize_nvols=2 if serialize_4d else np.inf,
)


@pytest.mark.parametrize("t", list(range(4)))
def test_apply_helper(monkeypatch, t):
"""Ensure the apply helper function correctly just decorates with index."""
from nitransforms.resampling import ndi

def _retval(*args, **kwargs):
return 1

monkeypatch.setattr(ndi, "map_coordinates", _retval)

assert _apply_volume(t, None, None) == (t, 1)

0 comments on commit ed1ffc8

Please sign in to comment.