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
15243a3f
Commit
15243a3f
authored
4 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
TEST: test new imrm script
parent
f879120a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_scripts/test_imrm.py
+50
-0
50 additions, 0 deletions
tests/test_scripts/test_imrm.py
with
50 additions
and
0 deletions
tests/test_scripts/test_imrm.py
0 → 100644
+
50
−
0
View file @
15243a3f
#!/usr/bin/env python
#
# test_imrm.py -
#
# Author: Paul McCarthy <pauldmccarthy@gmail.com>
#
import
os
from
fsl.utils.tempdir
import
tempdir
import
fsl.scripts.imrm
as
imrm
from
tests
import
touch
def
test_imrm_usage
():
assert
imrm
.
main
([
'
imrm
'
])
!=
0
def
test_imrm
():
# (files present, command, expected)
tests
=
[
(
'
a.nii
'
,
'
a
'
,
''
),
(
'
a.nii.gz
'
,
'
a
'
,
''
),
(
'
a.img a.hdr
'
,
'
a
'
,
''
),
(
'
a.img
'
,
'
a
'
,
''
),
(
'
a.hdr
'
,
'
a
'
,
''
),
(
'
a.nii b.nii
'
,
'
a
'
,
'
b.nii
'
),
(
'
a.nii b.nii
'
,
'
a b
'
,
''
),
(
'
a.nii b.nii
'
,
'
a b.nii
'
,
''
),
# suffix doesn't have to be correct
(
'
a.nii.gz
'
,
'
a.nii
'
,
''
),
# files don't exist -> no problem
(
'
a.nii
'
,
'
b
'
,
'
a.nii
'
),
]
for
files
,
command
,
expected
in
tests
:
with
tempdir
():
for
f
in
files
.
split
():
touch
(
f
)
print
(
'
files
'
,
files
)
print
(
'
command
'
,
command
)
print
(
'
expected
'
,
expected
)
imrm
.
main
((
'
imrm
'
+
command
).
split
())
assert
sorted
(
os
.
listdir
())
==
sorted
(
expected
.
split
())
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