Skip to content

Commit 23d9502

Browse files
committed
tst: added test for false
1 parent bb2aa95 commit 23d9502

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

nipype/interfaces/base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,6 +1132,7 @@ def _format_arg(self, name, trait_spec, value):
11321132
Formats a trait containing argstr metadata
11331133
"""
11341134
argstr = trait_spec.argstr
1135+
iflogger.debug('%s_%s' %(name, str(value)))
11351136
if trait_spec.is_trait_type(traits.Bool):
11361137
if value:
11371138
# Boolean options have no format string. Just append options

nipype/interfaces/tests/test_base.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ class CommandLineInputSpec1(nib.CommandLineInputSpec):
236236
position=-1)
237237
noo = nib.traits.Int(argstr='-x %d', desc='an int')
238238
roo = nib.traits.Str(desc='not on command line')
239+
soo = nib.traits.Bool(argstr="-soo")
239240
nib.CommandLine.input_spec = CommandLineInputSpec1
240241
ci4 = nib.CommandLine(command='cmd')
241242
ci4.inputs.foo = 'foo'
@@ -244,10 +245,15 @@ class CommandLineInputSpec1(nib.CommandLineInputSpec):
244245
ci4.inputs.moo = [1, 2, 3]
245246
ci4.inputs.noo = 0
246247
ci4.inputs.roo = 'hello'
248+
ci4.inputs.soo = False
247249
cmd = ci4._parse_inputs()
248250
yield assert_equal, cmd[0], '-g'
249251
yield assert_equal, cmd[-1], '-i 1 -i 2 -i 3'
250252
yield assert_true, 'hello' not in ' '.join(cmd)
253+
yield assert_true, '-soo' not in ' '.join(cmd)
254+
ci4.inputs.soo = True
255+
cmd = ci4._parse_inputs()
256+
yield assert_true, '-soo' in ' '.join(cmd)
251257

252258
class CommandLineInputSpec2(nib.CommandLineInputSpec):
253259
foo = nib.File(argstr='%s', desc='a str', genfile=True)

0 commit comments

Comments
 (0)