Skip to content

Commit 295e356

Browse files
author
Christopher Burns
committed
Add more tests for sneeze.
1 parent b0c611b commit 295e356

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

tools/test_sneeze.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,23 @@
66
from nipy.testing import *
77
from sneeze import find_pkg, run_nose
88

9-
import_strings = ["from nipype.interfaces.afni import To3d",
9+
import_strings = ["from nipype.interfaces.afni import To3d, ThreeDRefit",
1010
"from nipype.interfaces import afni",
11-
"import nipype.interfaces.afni"]
11+
"import nipype.interfaces.afni",
12+
"from nipype.interfaces import afni as af"]
1213

13-
def test_from_namespace():
14+
def test_imports():
1415
dname = mkdtemp()
1516
fname = os.path.join(dname, 'test_afni.py')
16-
fp = open(fname, 'w')
17-
fp.write('from nipype.interfaces.afni import To3d')
18-
fp.close()
19-
cover_pkg, module = find_pkg(fname)
20-
cmd = run_nose(cover_pkg, fname, dry_run=True)
21-
cmdlst = cmd.split()
22-
cmd = ' '.join(cmdlst[:4]) # strip off temporary directory path
23-
#print cmd
24-
assert_equal(cmd, 'nosetests -sv --with-coverage --cover-package=nipype.interfaces.afni')
17+
for impt in import_strings:
18+
fp = open(fname, 'w')
19+
fp.write(impt)
20+
fp.close()
21+
cover_pkg, module = find_pkg(fname)
22+
cmd = run_nose(cover_pkg, fname, dry_run=True)
23+
cmdlst = cmd.split()
24+
cmd = ' '.join(cmdlst[:4]) # strip off temporary directory path
25+
yield assert_equal, cmd, \
26+
'nosetests -sv --with-coverage --cover-package=nipype.interfaces.afni'
2527
if os.path.exists(dname):
2628
rmtree(dname)

0 commit comments

Comments
 (0)