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
9694f705
Commit
9694f705
authored
3 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
TEST: Test creating multiple wrappers for one command
parent
a59c0504
No related branches found
Branches containing commit
No related tags found
1 merge request
!48
Mnt/wrapper comments
Pipeline
#12540
passed
3 years ago
Stage: fsl-ci-build
Changes
1
Pipelines
3
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 @
9694f705
...
...
@@ -345,6 +345,46 @@ def test_create_wrappers_rename():
assert
not
op
.
exists
(
wrapper
)
def
test_create_wrappers_multiple_same
():
"""
Tests creating multiple wrapper scripts which call the same
target command.
"""
# Keys are passed to createFSLWrapper, values
# are wrappers that should be created
scripts
=
{
'
scripta
'
:
'
scripta
'
,
'
scripta=script1
'
:
'
script1
'
,
'
scripta=script2
'
:
'
script2
'
,
'
scriptb
'
:
'
scriptb
'
,
'
scriptc=script3
'
:
'
script3
'
,
'
scriptc=script4
'
:
'
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