Skip to content

Commit c9eea71

Browse files
committed
add a couple of tests
1 parent e2ac4c7 commit c9eea71

File tree

1 file changed

+32
-5
lines changed

1 file changed

+32
-5
lines changed

nipype/interfaces/base/support.py

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,20 @@ def version(self):
239239

240240

241241
def format_help(cls):
242-
"""Prints help text of a Nipype interface"""
242+
"""
243+
Prints help text of a Nipype interface
244+
245+
>>> from nipype.interfaces.afni import GCOR
246+
>>> GCOR.help() # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE
247+
Wraps the executable command ``@compute_gcor``.
248+
<BLANKLINE>
249+
Computes the average correlation between every voxel
250+
and ever other voxel, over any give mask.
251+
<BLANKLINE>
252+
<BLANKLINE>
253+
For complete details, ...
254+
255+
"""
243256
from ...utils.misc import trim
244257

245258
docstring = []
@@ -260,7 +273,14 @@ def format_help(cls):
260273

261274

262275
def _inputs_help(cls):
263-
"""Prints description for input parameters"""
276+
r"""
277+
Prints description for input parameters
278+
279+
>>> from nipype.interfaces.afni import GCOR
280+
>>> _inputs_help(GCOR) # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE
281+
['Inputs::', '', '\t[Mandatory]', '\tin_file: (an existing file name)', ...
282+
283+
"""
264284
helpstr = ['Inputs::', '']
265285
mandatory_keys = []
266286
optional_items = []
@@ -286,7 +306,14 @@ def _inputs_help(cls):
286306

287307

288308
def _outputs_help(cls):
289-
"""Prints description for output parameters"""
309+
r"""
310+
Prints description for output parameters
311+
312+
>>> from nipype.interfaces.afni import GCOR
313+
>>> _outputs_help(GCOR) # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE
314+
['Outputs::', '', '\tout: (a float)\n\t\tglobal correlation value']
315+
316+
"""
290317
helpstr = ['Outputs::', '', '\tNone']
291318
if cls.output_spec:
292319
outputs = cls.output_spec()
@@ -346,13 +373,13 @@ def _get_trait_desc(inputs, name, spec):
346373
pos = spec.position
347374
if pos is not None:
348375
manhelpstr += wrap(
349-
'flag: %s, position: %s' % (argstr, pos),
376+
'argument: ``%s``, position: %s' % (argstr, pos),
350377
HELP_LINEWIDTH,
351378
initial_indent='\t\t',
352379
subsequent_indent='\t\t')
353380
else:
354381
manhelpstr += wrap(
355-
'flag: %s' % argstr,
382+
'argument: ``%s``' % argstr,
356383
HELP_LINEWIDTH,
357384
initial_indent='\t\t',
358385
subsequent_indent='\t\t')

0 commit comments

Comments
 (0)