Skip to content

Commit f27ea7c

Browse files
committed
Updated test to fix problems
1 parent f694a0a commit f27ea7c

File tree

2 files changed

+29
-3
lines changed

2 files changed

+29
-3
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
2+
from nipype.testing import assert_equal
3+
from nipype.algorithms.misc import NormalizeProbabilityMapSet
4+
5+
def test_NormalizeProbabilityMapSet_inputs():
6+
input_map = dict(in_files=dict(),
7+
in_mask=dict(mandatory=False,
8+
),
9+
)
10+
inputs = NormalizeProbabilityMapSet.input_spec()
11+
12+
for key, metadata in input_map.items():
13+
for metakey, value in metadata.items():
14+
yield assert_equal, getattr(inputs.traits()[key], metakey), value
15+
16+
def test_NormalizeProbabilityMapSet_outputs():
17+
output_map = dict(out_files=dict(),
18+
)
19+
outputs = NormalizeProbabilityMapSet.output_spec()
20+
21+
for key, metadata in output_map.items():
22+
for metakey, value in metadata.items():
23+
yield assert_equal, getattr(outputs.traits()[key], metakey), value
24+

nipype/algorithms/tests/test_normalize_tpms.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66
# @Author: oesteban - [email protected]
77
# @Date: 2014-05-28 17:57:20
88
# @Last Modified by: oesteban
9-
# @Last Modified time: 2014-05-28 18:55:27
9+
# @Last Modified time: 2014-05-29 13:23:56
1010

1111
import os
1212
from shutil import rmtree
1313
from tempfile import mkdtemp
1414

15+
from nipype.testing import (assert_equal,assert_raises,
16+
assert_almost_equal,example_data )
1517

1618
import numpy as np
1719
import nibabel as nb
@@ -22,7 +24,7 @@
2224
def test_normalize_tpms():
2325
tempdir = mkdtemp()
2426

25-
in_mask = os.path.join(nit.basedir, 'data' , 'tpms_msk.nii.gz' )
27+
in_mask = example_data('tpms_msk.nii.gz' )
2628
mskdata = nb.load( in_mask ).get_data()
2729
mskdata[mskdata>0.0] = 1.0
2830

@@ -31,7 +33,7 @@ def test_normalize_tpms():
3133
out_files = []
3234

3335
for i in range(3):
34-
mapname = os.path.join(nit.basedir, 'data' , 'tpm_%02d.nii.gz' % i)
36+
mapname = example_data('tpm_%02d.nii.gz' % i)
3537
filename = os.path.join(tempdir, 'modtpm_%02d.nii.gz' % i )
3638
out_files.append(os.path.join(tempdir, 'normtpm_%02d.nii.gz' % i ))
3739

0 commit comments

Comments
 (0)