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 9f91e2f commit 4c06174
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
6 changes: 6 additions & 0 deletions nitransforms/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,12 @@ def __len__(self):
By default, all transforms are of length one.
This must be overriden by transforms arrays and chains.
Example
-------
>>> T1 = TransformBase()
>>> len(T1)
1
"""
return 1

Expand Down
15 changes: 15 additions & 0 deletions nitransforms/tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,18 @@ def test_SurfaceMesh(testdata_path):

with pytest.raises(TypeError):
SurfaceMesh(nb.load(shape_path))


def test_apply_deprecation(monkeypatch):
"""Make sure a deprecation warning is issued."""
from nitransforms import resampling

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

monkeypatch.setattr(resampling, "apply", _retval)

with pytest.deprecated_call():
retval = TransformBase().apply()

assert retval == 1

0 comments on commit 4c06174

Please sign in to comment.