Skip to content

Commit 672661e

Browse files
committed
added a test for cmdline function
1 parent 59006b0 commit 672661e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

nibabel/tests/test_scripts.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,16 @@ def check_nib_ls_example4d(opts=[], hdrs_str="", other_str=""):
6969

7070

7171
def check_nib_diff_examples():
72+
fnames = [pjoin(DATA_PATH, f)
73+
for f in ('standard.nii.gz', 'example4d.nii.gz')]
74+
code, stdout, stderr = run_command(['nib-diff'] + fnames, check_code=False)
75+
checked_fields = ["Field", "regular", "dim_info", "dim", "datatype", "bitpix", "pixdim", "slice_end",
76+
"xyzt_units", "cal_max", "descrip", "qform_code", "sform_code", "quatern_b",
77+
"quatern_c", "quatern_d", "qoffset_x", "qoffset_y", "qoffset_z", "srow_x",
78+
"srow_y", "srow_z"]
79+
for item in checked_fields:
80+
assert_true(item in stdout)
81+
7282
fnames2 = [pjoin(DATA_PATH, f)
7383
for f in ('example4d.nii.gz', 'example4d.nii.gz')]
7484
code, stdout, stderr = run_command(['nib-diff'] + fnames2, check_code=False)

0 commit comments

Comments
 (0)