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
Package registry
Model registry
Operate
Environments
Terraform modules
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
Evan Edmond
fslpy
Commits
e92f2cb0
Commit
e92f2cb0
authored
4 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
STY: whitespace
parent
d0be230e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_featanalysis.py
+18
-18
18 additions, 18 deletions
tests/test_featanalysis.py
with
18 additions
and
18 deletions
tests/test_featanalysis.py
+
18
−
18
View file @
e92f2cb0
...
...
@@ -59,7 +59,7 @@ def test_isFEATDir():
# it's not a feat directory
assert
not
featanalysis
.
isFEATDir
(
'
nonexistent.feat
'
)
# If any of the above files are not
# If any of the above files are not
# present, it is not a FEAT directory
perms
=
it
.
chain
(
it
.
combinations
(
paths
,
1
),
it
.
combinations
(
paths
,
2
),
...
...
@@ -69,7 +69,7 @@ def test_isFEATDir():
assert
not
featanalysis
.
isFEATDir
(
op
.
join
(
testdir
,
'
analysis.feat
'
))
def
test_hasStats
():
with
tests
.
testdir
([
'
analysis.feat/stats/zstat1.nii.gz
'
])
as
testdir
:
...
...
@@ -78,7 +78,7 @@ def test_hasStats():
with
tests
.
testdir
([
'
analysis.feat/stats/zstat1.txt
'
])
as
testdir
:
featdir
=
op
.
join
(
testdir
,
'
analysis.feat
'
)
assert
not
featanalysis
.
hasStats
(
featdir
)
assert
not
featanalysis
.
hasStats
(
featdir
)
def
test_hasMelodicDir
():
...
...
@@ -94,7 +94,7 @@ def test_getAnalysisDir():
'
analysis.feat/design.fsf
'
,
'
analysis.feat/design.mat
'
,
'
analysis.feat/design.con
'
]
testpaths
=
[
'
analysis.feat/filtered_func_data.nii.gz
'
,
'
analysis.feat/stats/zstat1.nii.gz
'
,
'
analysis.feat/logs/feat4_post
'
,
...
...
@@ -106,7 +106,7 @@ def test_getAnalysisDir():
t
=
op
.
join
(
testdir
,
t
)
assert
featanalysis
.
getAnalysisDir
(
t
)
==
expected
def
test_getTopLevelAnalysisDir
():
testcases
=
[
(
'
analysis.feat/filtered_func_data.ica/melodic_IC.nii.gz
'
,
'
analysis.feat
'
),
...
...
@@ -127,7 +127,7 @@ def test_getReportFile():
for
paths
,
expected
in
testcases
:
with
tests
.
testdir
(
paths
)
as
testdir
:
featdir
=
op
.
join
(
testdir
,
'
analysis.feat
'
)
if
expected
:
...
...
@@ -145,7 +145,7 @@ def test_loadContrasts():
/ContrastName1 c1
/ContrastName2 c2
/ContrastName3 c3
/NumContrasts 3
/NumContrasts 3
/Matrix
1 0 0
0 1 0
...
...
@@ -188,9 +188,9 @@ def test_loadContrasts():
0 1 1
"""
,
]
with
pytest
.
raises
(
Exception
):
featanalysis
.
loadContrasts
(
'
no file
'
)
featanalysis
.
loadContrasts
(
'
no file
'
)
with
tests
.
testdir
()
as
testdir
:
featdir
=
op
.
join
(
testdir
,
'
analysis.feat
'
)
...
...
@@ -275,7 +275,7 @@ def test_isFirstLevelAnalysis():
'
2ndlevel_1.gfeat
'
,
'
2ndlevel_2.gfeat
'
]
for
featdir
in
featdirs
:
expected
=
featdir
.
startswith
(
'
1
'
)
featdir
=
op
.
join
(
datadir
,
featdir
)
settings
=
featanalysis
.
loadSettings
(
featdir
)
...
...
@@ -393,9 +393,9 @@ def test_getResidualFile():
assert
featanalysis
.
getResidualFile
(
featdir
)
==
expect
else
:
with
pytest
.
raises
(
fslpath
.
PathError
):
featanalysis
.
getResidualFile
(
featdir
)
featanalysis
.
getResidualFile
(
featdir
)
def
test_getPEFile
():
testcases
=
[
([
'
analysis.feat/stats/pe1.nii.gz
'
,
...
...
@@ -417,7 +417,7 @@ def test_getPEFile():
assert
featanalysis
.
getPEFile
(
featdir
,
pei
)
==
expect
else
:
with
pytest
.
raises
(
fslpath
.
PathError
):
featanalysis
.
getPEFile
(
featdir
,
pei
)
featanalysis
.
getPEFile
(
featdir
,
pei
)
def
test_getCOPEFile
():
...
...
@@ -441,8 +441,8 @@ def test_getCOPEFile():
assert
featanalysis
.
getCOPEFile
(
featdir
,
ci
)
==
expect
else
:
with
pytest
.
raises
(
fslpath
.
PathError
):
featanalysis
.
getCOPEFile
(
featdir
,
ci
)
featanalysis
.
getCOPEFile
(
featdir
,
ci
)
def
test_getZStatFile
():
testcases
=
[
...
...
@@ -465,8 +465,8 @@ def test_getZStatFile():
assert
featanalysis
.
getZStatFile
(
featdir
,
zi
)
==
expect
else
:
with
pytest
.
raises
(
fslpath
.
PathError
):
featanalysis
.
getZStatFile
(
featdir
,
zi
)
featanalysis
.
getZStatFile
(
featdir
,
zi
)
def
test_getClusterMaskFile
():
testcases
=
[
...
...
@@ -489,4 +489,4 @@ def test_getClusterMaskFile():
assert
featanalysis
.
getClusterMaskFile
(
featdir
,
ci
)
==
expect
else
:
with
pytest
.
raises
(
fslpath
.
PathError
):
featanalysis
.
getClusterMaskFile
(
featdir
,
ci
)
featanalysis
.
getClusterMaskFile
(
featdir
,
ci
)
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