Skip to content

Commit 8c8e6d8

Browse files
committed
added a functionality test for cmdline access of datatype
1 parent 7315931 commit 8c8e6d8

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

nibabel/cmdline/diff.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,13 +304,12 @@ def diff(files, header_fields='all', data_max_abs_diff=None, data_max_rel_diff=N
304304
return diff
305305

306306

307-
def main(args=None, out=None, dtype=None):
307+
def main(args=None, out=None):
308308
"""Getting the show on the road"""
309309

310310
out = out or sys.stdout
311311
parser = get_opt_parser()
312312
(opts, files) = parser.parse_args(args)
313-
dtype = dtype or opts.dtype
314313

315314
nibabel.cmdline.utils.verbose_level = opts.verbose
316315

@@ -323,7 +322,7 @@ def main(args=None, out=None, dtype=None):
323322
header_fields=opts.header_fields,
324323
data_max_abs_diff=opts.data_max_abs_diff,
325324
data_max_rel_diff=opts.data_max_rel_diff,
326-
dtype=dtype
325+
dtype=opts.dtype
327326
)
328327

329328
if files_diff:

nibabel/tests/test_scripts.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ def check_nib_diff_examples():
9595
code, stdout, stderr = run_command(['nib-diff'] + fnames4, check_code=False)
9696
assert_equal(stdout, "These files are identical.")
9797

98+
code, stdout, stderr = run_command(['nib-diff', '--dt'] + ['float64'] + fnames, check_code=False)
99+
for item in checked_fields:
100+
assert_true(item in stdout)
101+
98102

99103

100104
@script_test

0 commit comments

Comments
 (0)