Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FSL
fslpy
Commits
4f7aca98
Commit
4f7aca98
authored
Apr 18, 2017
by
Paul McCarthy
Browse files
More fixes to fixlabels tests.
parent
81166394
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/test_fixlabels.py
View file @
4f7aca98
...
...
@@ -333,9 +333,10 @@ def test_saveLabelFile():
fname
=
op
.
join
(
testdir
,
'fname.txt'
)
# dirname=None, listBad=False
exp
=
'.
\n
{}'
.
format
(
expected
)
fixlabels
.
saveLabelFile
(
labels
,
fname
,
listBad
=
False
)
with
open
(
fname
,
'rt'
)
as
f
:
assert
f
.
read
().
strip
()
==
exp
ected
assert
f
.
read
().
strip
()
==
exp
# dirname=something, listBad=False
dirname
=
'Blob/a.ica'
...
...
@@ -346,13 +347,14 @@ def test_saveLabelFile():
# dirname=None, listBad=True
fixlabels
.
saveLabelFile
(
labels
,
fname
)
exp
=
'{}
\n
[1, 3, 4]'
.
format
(
expected
)
exp
=
'
.
\n
{}
\n
[1, 3, 4]'
.
format
(
expected
)
with
open
(
fname
,
'rt'
)
as
f
:
assert
f
.
read
().
strip
()
==
exp
# Custom signal labels
sigLabels
=
[
'Label1'
]
exp
=
textwrap
.
dedent
(
"""
.
1, Label1, Label2, Label3, False
2, Signal, True
3, Noise, True
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment