Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FSL
fslpy
Commits
37c10106
Commit
37c10106
authored
1 year ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
TEST: More updated test paths
parent
b323b520
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
MANIFEST.in
+1
-0
1 addition, 0 deletions
MANIFEST.in
fsl/tests/test_settings.py
+1
-1
1 addition, 1 deletion
fsl/tests/test_settings.py
fsl/tests/test_vest.py
+1
-1
1 addition, 1 deletion
fsl/tests/test_vest.py
fsl/tests/test_volumelabels.py
+26
-26
26 additions, 26 deletions
fsl/tests/test_volumelabels.py
with
29 additions
and
28 deletions
MANIFEST.in
+
1
−
0
View file @
37c10106
...
@@ -3,5 +3,6 @@ include CHANGELOG.rst
...
@@ -3,5 +3,6 @@ include CHANGELOG.rst
include COPYRIGHT
include COPYRIGHT
include LICENSE
include LICENSE
include README.rst
include README.rst
include conftest.py
recursive-include doc *
recursive-include doc *
recursive-include fsl/tests *
recursive-include fsl/tests *
This diff is collapsed.
Click to expand it.
fsl/tests/test_settings.py
+
1
−
1
View file @
37c10106
...
@@ -16,7 +16,7 @@ import unittest.mock as mock
...
@@ -16,7 +16,7 @@ import unittest.mock as mock
import
pytest
import
pytest
import
tests
import
fsl.tests
as
tests
import
fsl.utils.settings
as
settings
import
fsl.utils.settings
as
settings
import
fsl.utils.tempdir
as
tempdir
import
fsl.utils.tempdir
as
tempdir
...
...
This diff is collapsed.
Click to expand it.
fsl/tests/test_vest.py
+
1
−
1
View file @
37c10106
...
@@ -18,7 +18,7 @@ import pytest
...
@@ -18,7 +18,7 @@ import pytest
import
fsl.data.vest
as
vest
import
fsl.data.vest
as
vest
from
tests
import
tempdir
from
fsl.
tests
import
tempdir
testfile1
=
"""
%!VEST-LUT
testfile1
=
"""
%!VEST-LUT
...
...
This diff is collapsed.
Click to expand it.
fsl/tests/test_volumelabels.py
+
26
−
26
View file @
37c10106
...
@@ -11,29 +11,29 @@ import textwrap
...
@@ -11,29 +11,29 @@ import textwrap
import
pytest
import
pytest
import
tests
import
fsl.tests
as
tests
import
fsl.data.fixlabels
as
fixlbls
import
fsl.data.fixlabels
as
fixlbls
import
fsl.data.volumelabels
as
vollbls
import
fsl.data.volumelabels
as
vollbls
def
test_add_get_hasLabel
():
def
test_add_get_hasLabel
():
ncomps
=
5
ncomps
=
5
labels
=
[
'
Label {}
'
.
format
(
i
)
for
i
in
range
(
ncomps
)]
labels
=
[
'
Label {}
'
.
format
(
i
)
for
i
in
range
(
ncomps
)]
lowers
=
[
lbl
.
lower
()
for
lbl
in
labels
]
lowers
=
[
lbl
.
lower
()
for
lbl
in
labels
]
lblobj
=
vollbls
.
VolumeLabels
(
ncomps
)
lblobj
=
vollbls
.
VolumeLabels
(
ncomps
)
called
=
[
False
]
called
=
[
False
]
def
labelAdded
(
lo
,
topic
,
value
):
def
labelAdded
(
lo
,
topic
,
value
):
called
[
0
]
=
True
called
[
0
]
=
True
lblobj
.
register
(
'
callback
'
,
labelAdded
,
topic
=
'
added
'
)
lblobj
.
register
(
'
callback
'
,
labelAdded
,
topic
=
'
added
'
)
for
i
in
range
(
ncomps
):
for
i
in
range
(
ncomps
):
called
[
0
]
=
False
called
[
0
]
=
False
assert
lblobj
.
addLabel
(
i
,
labels
[
i
])
assert
lblobj
.
addLabel
(
i
,
labels
[
i
])
assert
called
[
0
]
assert
called
[
0
]
assert
lblobj
.
getLabels
(
i
)
==
[
lowers
[
i
]]
assert
lblobj
.
getLabels
(
i
)
==
[
lowers
[
i
]]
...
@@ -47,7 +47,7 @@ def test_add_get_hasLabel():
...
@@ -47,7 +47,7 @@ def test_add_get_hasLabel():
called
[
0
]
=
False
called
[
0
]
=
False
assert
not
lblobj
.
addLabel
(
i
,
labels
[
i
])
assert
not
lblobj
.
addLabel
(
i
,
labels
[
i
])
assert
not
called
[
0
]
assert
not
called
[
0
]
# Labels are case insensitive
# Labels are case insensitive
assert
not
lblobj
.
addLabel
(
i
,
lowers
[
i
])
assert
not
lblobj
.
addLabel
(
i
,
lowers
[
i
])
assert
not
called
[
0
]
assert
not
called
[
0
]
...
@@ -56,7 +56,7 @@ def test_add_get_hasLabel():
...
@@ -56,7 +56,7 @@ def test_add_get_hasLabel():
def
test_removeLabel
():
def
test_removeLabel
():
ncomps
=
5
ncomps
=
5
labels
=
[
'
Label {}
'
.
format
(
i
)
for
i
in
range
(
ncomps
)]
labels
=
[
'
Label {}
'
.
format
(
i
)
for
i
in
range
(
ncomps
)]
lowers
=
[
lbl
.
lower
()
for
lbl
in
labels
]
lowers
=
[
lbl
.
lower
()
for
lbl
in
labels
]
...
@@ -66,7 +66,7 @@ def test_removeLabel():
...
@@ -66,7 +66,7 @@ def test_removeLabel():
lblobj
.
addLabel
(
i
,
labels
[
i
])
lblobj
.
addLabel
(
i
,
labels
[
i
])
called
=
[
False
]
called
=
[
False
]
def
removed
(
*
a
):
def
removed
(
*
a
):
called
[
0
]
=
True
called
[
0
]
=
True
...
@@ -80,14 +80,14 @@ def test_removeLabel():
...
@@ -80,14 +80,14 @@ def test_removeLabel():
called
[
0
]
=
False
called
[
0
]
=
False
assert
lblobj
.
removeLabel
(
i
,
labels
[
i
])
assert
lblobj
.
removeLabel
(
i
,
labels
[
i
])
assert
called
[
0
]
assert
called
[
0
]
assert
lblobj
.
getLabels
(
i
)
==
[]
assert
lblobj
.
getLabels
(
i
)
==
[]
assert
sorted
(
lblobj
.
getAllLabels
())
==
lowers
[
i
+
1
:]
assert
sorted
(
lblobj
.
getAllLabels
())
==
lowers
[
i
+
1
:]
def
test_clearLabels
():
def
test_clearLabels
():
ncomps
=
5
ncomps
=
5
labels
=
[(
'
Label {}
'
.
format
(
i
),
'
Label b
'
)
labels
=
[(
'
Label {}
'
.
format
(
i
),
'
Label b
'
)
for
i
in
range
(
ncomps
)]
for
i
in
range
(
ncomps
)]
...
@@ -99,7 +99,7 @@ def test_clearLabels():
...
@@ -99,7 +99,7 @@ def test_clearLabels():
lblobj
.
addLabel
(
i
,
l
)
lblobj
.
addLabel
(
i
,
l
)
calledValue
=
[]
calledValue
=
[]
def
removed
(
lo
,
topic
,
value
):
def
removed
(
lo
,
topic
,
value
):
calledValue
.
append
(
value
)
calledValue
.
append
(
value
)
...
@@ -125,14 +125,14 @@ def test_add_get_hasComponents():
...
@@ -125,14 +125,14 @@ def test_add_get_hasComponents():
lblobj
=
vollbls
.
VolumeLabels
(
ncomps
)
lblobj
=
vollbls
.
VolumeLabels
(
ncomps
)
called
=
[
False
]
called
=
[
False
]
def
labelAdded
(
lo
,
topic
,
value
):
def
labelAdded
(
lo
,
topic
,
value
):
called
[
0
]
=
True
called
[
0
]
=
True
lblobj
.
register
(
'
callback
'
,
labelAdded
,
topic
=
'
added
'
)
lblobj
.
register
(
'
callback
'
,
labelAdded
,
topic
=
'
added
'
)
for
i
in
range
(
ncomps
):
for
i
in
range
(
ncomps
):
called
[
0
]
=
False
called
[
0
]
=
False
assert
lblobj
.
addComponent
(
labels
[
i
],
i
)
assert
lblobj
.
addComponent
(
labels
[
i
],
i
)
assert
called
[
0
]
assert
called
[
0
]
...
@@ -167,8 +167,8 @@ def test_removeComponent():
...
@@ -167,8 +167,8 @@ def test_removeComponent():
called
[
0
]
=
False
called
[
0
]
=
False
assert
lblobj
.
removeComponent
(
labels
[
i
],
i
)
assert
lblobj
.
removeComponent
(
labels
[
i
],
i
)
assert
called
[
0
]
assert
called
[
0
]
assert
lblobj
.
getComponents
(
labels
[
i
])
==
[]
assert
lblobj
.
getComponents
(
labels
[
i
])
==
[]
assert
sorted
(
lblobj
.
getAllLabels
())
==
labels
[
i
+
1
:]
assert
sorted
(
lblobj
.
getAllLabels
())
==
labels
[
i
+
1
:]
...
@@ -184,7 +184,7 @@ def test_clearComponents():
...
@@ -184,7 +184,7 @@ def test_clearComponents():
lblobj
.
addLabel
(
i
,
l
)
lblobj
.
addLabel
(
i
,
l
)
calledValue
=
[]
calledValue
=
[]
def
removed
(
lo
,
topic
,
value
):
def
removed
(
lo
,
topic
,
value
):
calledValue
.
append
(
value
)
calledValue
.
append
(
value
)
...
@@ -199,11 +199,11 @@ def test_clearComponents():
...
@@ -199,11 +199,11 @@ def test_clearComponents():
labels
=
[
l
[
0
]
for
l
in
labels
]
labels
=
[
l
[
0
]
for
l
in
labels
]
for
i
in
range
(
ncomps
):
for
i
in
range
(
ncomps
):
calledValue
=
[]
calledValue
=
[]
lblobj
.
clearComponents
(
labels
[
i
])
lblobj
.
clearComponents
(
labels
[
i
])
assert
calledValue
[
0
]
==
[(
i
,
labels
[
i
])]
assert
calledValue
[
0
]
==
[(
i
,
labels
[
i
])]
assert
lblobj
.
getComponents
(
labels
[
i
])
==
[]
assert
lblobj
.
getComponents
(
labels
[
i
])
==
[]
assert
lblobj
.
getLabels
(
i
)
==
[]
assert
lblobj
.
getLabels
(
i
)
==
[]
...
@@ -250,7 +250,7 @@ def test_load_fixfile_long():
...
@@ -250,7 +250,7 @@ def test_load_fixfile_long():
lblobj
=
vollbls
.
VolumeLabels
(
4
)
lblobj
=
vollbls
.
VolumeLabels
(
4
)
lblobj
.
load
(
fname
)
lblobj
.
load
(
fname
)
for
i
in
range
(
4
):
for
i
in
range
(
4
):
assert
lblobj
.
getLabels
(
i
)
==
expected
[
i
]
assert
lblobj
.
getLabels
(
i
)
==
expected
[
i
]
def
test_load_fixfile_short
():
def
test_load_fixfile_short
():
...
@@ -285,7 +285,7 @@ def test_load_fixfile_short():
...
@@ -285,7 +285,7 @@ def test_load_fixfile_short():
lblobj
=
vollbls
.
VolumeLabels
(
5
)
lblobj
=
vollbls
.
VolumeLabels
(
5
)
lblobj
.
load
(
fname
)
lblobj
.
load
(
fname
)
for
i
in
range
(
4
):
for
i
in
range
(
4
):
assert
lblobj
.
getLabels
(
i
)
==
expected
[
i
]
assert
lblobj
.
getLabels
(
i
)
==
expected
[
i
]
def
test_load_aromafile
():
def
test_load_aromafile
():
...
@@ -320,7 +320,7 @@ def test_load_aromafile():
...
@@ -320,7 +320,7 @@ def test_load_aromafile():
lblobj
=
vollbls
.
VolumeLabels
(
5
)
lblobj
=
vollbls
.
VolumeLabels
(
5
)
lblobj
.
load
(
fname
)
lblobj
.
load
(
fname
)
for
i
in
range
(
4
):
for
i
in
range
(
4
):
assert
lblobj
.
getLabels
(
i
)
==
expected
[
i
]
assert
lblobj
.
getLabels
(
i
)
==
expected
[
i
]
def
test_save
():
def
test_save
():
...
@@ -341,15 +341,15 @@ def test_save():
...
@@ -341,15 +341,15 @@ def test_save():
lbls
.
addLabel
(
3
,
'
Movement
'
)
lbls
.
addLabel
(
3
,
'
Movement
'
)
with
tests
.
testdir
()
as
testdir
:
with
tests
.
testdir
()
as
testdir
:
fname
=
op
.
join
(
testdir
,
'
labels.txt
'
)
fname
=
op
.
join
(
testdir
,
'
labels.txt
'
)
# Test saving without dirname
# Test saving without dirname
lbls
.
save
(
fname
)
lbls
.
save
(
fname
)
exp
=
'
.
\n
{}
'
.
format
(
expected
)
exp
=
'
.
\n
{}
'
.
format
(
expected
)
with
open
(
fname
,
'
rt
'
)
as
f
:
with
open
(
fname
,
'
rt
'
)
as
f
:
assert
f
.
read
().
strip
()
==
exp
.
strip
()
assert
f
.
read
().
strip
()
==
exp
.
strip
()
# And with dirname
# And with dirname
lbls
.
save
(
fname
,
'
path/to/analysis.ica
'
)
lbls
.
save
(
fname
,
'
path/to/analysis.ica
'
)
exp
=
'
path/to/analysis.ica
\n
{}
'
.
format
(
expected
)
exp
=
'
path/to/analysis.ica
\n
{}
'
.
format
(
expected
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment