Skip to content

Commit 8790b99

Browse files
committed
Merge pull request #452 from yarikoptic/master
MRG: allow for int type string in ls on BE begin with <i Closes #422
2 parents 6171942 + 2067982 commit 8790b99

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

nibabel/tests/test_scripts.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"""
77
from __future__ import division, print_function, absolute_import
88

9+
import sys
910
import os
1011
from os.path import (dirname, join as pjoin, abspath, splitext, basename,
1112
exists)
@@ -97,9 +98,10 @@ def test_nib_ls_multiple():
9798

9899
# they should be indented correctly. Since all files are int type -
99100
ln = max(len(f) for f in fnames)
100-
assert_equal([l[ln:ln+2] for l in stdout_lines], [' i']*4,
101-
msg="Type sub-string didn't start with 'i'. "
102-
"Full output was: %s" % stdout_lines)
101+
i_str = ' i' if sys.byteorder == 'little' else ' <i'
102+
assert_equal([l[ln:ln + len(i_str)] for l in stdout_lines], [i_str] * 4,
103+
msg="Type sub-string didn't start with '%s'. "
104+
"Full output was: %s" % (i_str, stdout_lines))
103105
# and if disregard type indicator which might vary
104106
assert_equal(
105107
[l[l.index('['):] for l in stdout_lines],

0 commit comments

Comments
 (0)