def test_Proj_thresh(): proj = fsl.ProjThresh() # make sure command gets called yield assert_equal, proj.cmd, 'proj_thresh' # test raising error with mandatory args absent yield assert_raises, ValueError, proj.run # .inputs based parameters setting proj.inputs.volumes = ['vol1', 'vol2', 'vol3'] proj.inputs.threshold = 3 yield assert_equal, proj.cmdline, 'proj_thresh vol1 vol2 vol3 3' proj2 = fsl.ProjThresh(threshold=10, volumes=['vola', 'volb']) yield assert_equal, proj2.cmdline, 'proj_thresh vola volb 10' # .run based parameters setting proj3 = fsl.ProjThresh() results = proj3.run(volumes=['inp1', 'inp3', 'inp2'], threshold=2) yield assert_equal, results.runtime.cmdline, 'proj_thresh inp1 inp3 inp2 2' yield assert_not_equal, results.runtime.returncode, 0 yield assert_equal, isinstance(results.interface.inputs.volumes, list), True yield assert_equal, results.interface.inputs.threshold, 2
def test_Proj_thresh(): proj = fsl.ProjThresh() # make sure command gets called assert proj.cmd == "proj_thresh" # test raising error with mandatory args absent with pytest.raises(ValueError): proj.run() # .inputs based parameters setting proj.inputs.volumes = ["vol1", "vol2", "vol3"] proj.inputs.threshold = 3 assert proj.cmdline == "proj_thresh vol1 vol2 vol3 3" proj2 = fsl.ProjThresh(threshold=10, volumes=["vola", "volb"]) assert proj2.cmdline == "proj_thresh vola volb 10" # .run based parameters setting proj3 = fsl.ProjThresh() results = proj3.run(volumes=["inp1", "inp3", "inp2"], threshold=2) assert results.runtime.cmdline == "proj_thresh inp1 inp3 inp2 2" assert results.runtime.returncode != 0 assert isinstance(results.interface.inputs.volumes, list) assert results.interface.inputs.threshold == 2
def test_Proj_thresh(): proj = fsl.ProjThresh() # make sure command gets called assert proj.cmd == 'proj_thresh' # test raising error with mandatory args absent with pytest.raises(ValueError): proj.run() # .inputs based parameters setting proj.inputs.volumes = ['vol1', 'vol2', 'vol3'] proj.inputs.threshold = 3 assert proj.cmdline == 'proj_thresh vol1 vol2 vol3 3' proj2 = fsl.ProjThresh(threshold=10, volumes=['vola', 'volb']) assert proj2.cmdline == 'proj_thresh vola volb 10' # .run based parameters setting proj3 = fsl.ProjThresh() results = proj3.run(volumes=['inp1', 'inp3', 'inp2'], threshold=2) assert results.runtime.cmdline == 'proj_thresh inp1 inp3 inp2 2' assert results.runtime.returncode != 0 assert isinstance(results.interface.inputs.volumes, list) == True assert results.interface.inputs.threshold == 2
def test_projthresh(): input_map = dict(args = dict(argstr='%s',), environ = dict(), in_files = dict(argstr='%s',mandatory=True,), output_type = dict(), threshold = dict(mandatory=True,argstr='%d',), ) instance = fsl.ProjThresh() for key, metadata in input_map.items(): for metakey, value in metadata.items(): yield assert_equal, getattr(instance.inputs.traits()[key], metakey), value