Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
base
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
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
base
Commits
eeb2580c
Commit
eeb2580c
authored
3 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
TEST: Test createFSLWrapper rename capability
parent
5ab211b1
No related branches found
No related tags found
1 merge request
!47
ENH: New option in createFSLWrapper to generate wrapper script with different name to executable
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_create_remove_wrapper.py
+40
-0
40 additions, 0 deletions
tests/test_create_remove_wrapper.py
with
40 additions
and
0 deletions
tests/test_create_remove_wrapper.py
+
40
−
0
View file @
eeb2580c
...
...
@@ -305,6 +305,46 @@ def test_create_wrappers_no_handle_gui_wrappers():
assert
not
op
.
exists
(
wrapper
)
def
test_create_wrappers_rename
():
"""
Tests the renaming functionality in createFSLWrapper. If
$FSLDIR/bin/script exists, a wrapper with a different name
(e.g. $FSLDIR/share/fsl/bin/renamed_script) can be created by passing
"
script=renamed_script
"
.
"""
# Keys are passed to createFSLWrapper, values
# are wrappers that should be created
scripts
=
{
'
script1=renamed_script1
'
:
'
renamed_script1
'
,
'
script2=renamed_script2
'
:
'
renamed_script2
'
,
'
script3_gui=renamed_script3_gui
'
:
'
renamed_script3_gui
'
,
'
script4_gui=renamed_script4
'
:
'
renamed_script4
'
}
with
temp_fsldir
()
as
(
fsldir
,
wrapperdir
):
for
script
in
scripts
.
keys
():
target
=
script
.
split
(
'
=
'
)[
0
]
with
open
(
target
,
'
wt
'
)
as
f
:
touch
(
op
.
join
(
fsldir
,
'
bin
'
,
target
))
for
wrappers
in
it
.
permutations
(
scripts
.
keys
()):
args
=
'
'
.
join
(
wrappers
)
run
(
f
'
{
CREATE_WRAPPER
}
{
args
}
'
)
for
arg
in
wrappers
:
target
=
arg
.
split
(
'
=
'
)[
0
]
wrapper
=
op
.
join
(
wrapperdir
,
scripts
[
arg
])
assert
op
.
exists
(
wrapper
)
assert
get_called_command
(
wrapper
)
==
target
run
(
f
'
{
REMOVE_WRAPPER
}
{
args
}
'
)
for
arg
in
wrappers
:
target
=
scripts
[
arg
]
wrapper
=
op
.
join
(
wrapperdir
,
target
)
assert
not
op
.
exists
(
wrapper
)
if
__name__
==
'
__main__
'
:
# base dir can be speecified on command line
if
len
(
sys
.
argv
)
>
1
:
...
...
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