|
2 | 2 | from collections import namedtuple |
3 | 3 | from ...base import traits, TraitedSpec, BaseInterfaceInputSpec |
4 | 4 | from ..base import (convert_to_traits_type, create_interface_specs, |
5 | | - dipy_to_nipype_interface, DipyBaseInterface) |
6 | | -from dipy.workflows.workflow import Workflow |
| 5 | + dipy_to_nipype_interface, DipyBaseInterface, no_dipy) |
7 | 6 |
|
8 | 7 |
|
9 | 8 | def test_convert_to_traits_type(): |
@@ -84,35 +83,36 @@ def test_create_interface_specs(): |
84 | 83 | assert 'out_params' in current_params.keys() |
85 | 84 |
|
86 | 85 |
|
87 | | -class DummyWorkflow(Workflow): |
88 | | - |
89 | | - @classmethod |
90 | | - def get_short_name(cls): |
91 | | - return 'dwf1' |
92 | | - |
93 | | - def run(self, in_files, param1=1, out_dir='', out_ref='out1.txt'): |
94 | | - """Workflow used to test basic workflows. |
95 | | -
|
96 | | - Parameters |
97 | | - ---------- |
98 | | - in_files : string |
99 | | - fake input string param |
100 | | - param1 : int, optional |
101 | | - fake positional param (default 1) |
102 | | - out_dir : string, optional |
103 | | - fake output directory (default '') |
104 | | - out_ref : string, optional |
105 | | - fake out file (default out1.txt) |
106 | | -
|
107 | | - References |
108 | | - ----------- |
109 | | - dummy references |
110 | | -
|
111 | | - """ |
112 | | - return param1 |
113 | | - |
114 | | - |
| 86 | +@pytest.mark.skipif(no_dipy(), reason="DIPY is not installed") |
115 | 87 | def test_dipy_to_nipype_interface(): |
| 88 | + from dipy.workflows.workflow import Workflow |
| 89 | + |
| 90 | + class DummyWorkflow(Workflow): |
| 91 | + |
| 92 | + @classmethod |
| 93 | + def get_short_name(cls): |
| 94 | + return 'dwf1' |
| 95 | + |
| 96 | + def run(self, in_files, param1=1, out_dir='', out_ref='out1.txt'): |
| 97 | + """Workflow used to test basic workflows. |
| 98 | +
|
| 99 | + Parameters |
| 100 | + ---------- |
| 101 | + in_files : string |
| 102 | + fake input string param |
| 103 | + param1 : int, optional |
| 104 | + fake positional param (default 1) |
| 105 | + out_dir : string, optional |
| 106 | + fake output directory (default '') |
| 107 | + out_ref : string, optional |
| 108 | + fake out file (default out1.txt) |
| 109 | +
|
| 110 | + References |
| 111 | + ----------- |
| 112 | + dummy references |
| 113 | +
|
| 114 | + """ |
| 115 | + return param1 |
116 | 116 |
|
117 | 117 | new_specs = dipy_to_nipype_interface("MyModelSpec", DummyWorkflow) |
118 | 118 | assert new_specs.__base__ == DipyBaseInterface |
|
0 commit comments