Skip to content
Snippets Groups Projects
Commit 1ab49ce6 authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

unit tests for ensure module

parent 976f5414
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python
#
# test_ensure.py -
#
# Author: Paul McCarthy <pauldmccarthy@gmail.com>
#
import numpy as np
import nibabel as nib
import fsl.utils.tempdir as tempdir
import fsl.utils.ensure as ensure
from . import make_random_image
def test_ensureIsImage():
with tempdir.tempdir():
img = make_random_image('image.nii')
assert ensure.ensureIsImage(img) is img
loaded = ensure.ensureIsImage('image.nii')
assert isinstance(loaded, nib.nifti1.Nifti1Image)
assert np.all(img.get_data() == loaded.get_data())
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment