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
8ea04159
Commit
8ea04159
authored
6 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
TEST: Test bad file extension input to immv/imcp
parent
47e0c37f
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_immv_imcp.py
+29
-4
29 additions, 4 deletions
tests/test_immv_imcp.py
with
29 additions
and
4 deletions
tests/test_immv_imcp.py
+
29
−
4
View file @
8ea04159
...
...
@@ -20,10 +20,11 @@ import pytest
import
nibabel
as
nib
import
fsl.utils.imcp
as
imcp
import
fsl.scripts.imcp
as
imcp_script
import
fsl.scripts.immv
as
immv_script
import
fsl.data.image
as
fslimage
from
fsl.utils.tempdir
import
tempdir
import
fsl.utils.imcp
as
imcp
import
fsl.scripts.imcp
as
imcp_script
import
fsl.scripts.immv
as
immv_script
import
fsl.data.image
as
fslimage
from
.
import
make_random_image
from
.
import
make_dummy_file
...
...
@@ -730,3 +731,27 @@ def test_imcp_shouldPass(move=False):
def
test_immv_shouldPass
():
test_imcp_shouldPass
(
move
=
True
)
def
test_imcp_badExt
():
with
tempdir
():
with
open
(
'
file.nii.gz
'
,
'
wt
'
)
as
f
:
f
.
write
(
'
1
'
)
result
=
imcp_script
.
main
([
'
file.nii
'
,
'
dest
'
])
assert
result
==
0
assert
op
.
exists
(
'
dest.nii.gz
'
)
def
test_immv_badExt
():
with
tempdir
():
with
open
(
'
file.nii.gz
'
,
'
wt
'
)
as
f
:
f
.
write
(
'
1
'
)
result
=
immv_script
.
main
([
'
file.nii
'
,
'
dest
'
])
assert
result
==
0
assert
op
.
exists
(
'
dest.nii.gz
'
)
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