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
Merge requests
!47
ENH: New option in createFSLWrapper to generate wrapper script with different name to executable
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
ENH: New option in createFSLWrapper to generate wrapper script with different name to executable
rf/rename-wrapper
into
master
Overview
0
Commits
4
Pipelines
1
Changes
1
Merged
Paul McCarthy
requested to merge
rf/rename-wrapper
into
master
3 years ago
Overview
0
Commits
4
Pipelines
1
Changes
1
Expand
0
0
Merge request reports
Viewing commit
eeb2580c
Prev
Next
Show latest version
1 file
+
40
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
eeb2580c
TEST: Test createFSLWrapper rename capability
· eeb2580c
Paul McCarthy
authored
3 years ago
tests/test_create_remove_wrapper.py
+
40
−
0
Options
@@ -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
:
Loading