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
39e1cf1f
Commit
39e1cf1f
authored
5 years ago
by
Michiel Cottaar
Browse files
Options
Downloads
Patches
Plain Diff
BUG: actually test the stated bug
I think these tests would have failed before refactoring
parent
22595d38
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_filetree/test_template.py
+9
-0
9 additions, 0 deletions
tests/test_filetree/test_template.py
with
9 additions
and
0 deletions
tests/test_filetree/test_template.py
+
9
−
0
View file @
39e1cf1f
...
@@ -25,3 +25,12 @@ def test_get_variables():
...
@@ -25,3 +25,12 @@ def test_get_variables():
assert
{
'
subject
'
:
'
01
'
,
'
session
'
:
'
A
'
}
==
utils
.
extract_variables
(
'
sub-{subject}/[ses-{session}]/T1w.nii.gz
'
,
'
sub-01/ses-A/T1w.nii.gz
'
)
assert
{
'
subject
'
:
'
01
'
,
'
session
'
:
'
A
'
}
==
utils
.
extract_variables
(
'
sub-{subject}/[ses-{session}]/T1w.nii.gz
'
,
'
sub-01/ses-A/T1w.nii.gz
'
)
with
pytest
.
raises
(
ValueError
):
with
pytest
.
raises
(
ValueError
):
utils
.
extract_variables
(
'
sub-{subject}/[ses-{session}]/T1w.nii.gz
'
,
'
sub-01/other/T1w.nii.gz
'
)
utils
.
extract_variables
(
'
sub-{subject}/[ses-{session}]/T1w.nii.gz
'
,
'
sub-01/other/T1w.nii.gz
'
)
def
test_multiple_optionals
():
with
pytest
.
raises
(
KeyError
):
utils
.
extract_variables
(
'
{var}[_{opt1}][_{opt2}]
'
,
'
test_foo
'
)
assert
{
'
var
'
:
'
test
'
,
'
opt1
'
:
None
,
'
opt2
'
:
None
}
==
utils
.
extract_variables
(
'
{var}[_{opt1}][_{opt2}]
'
,
'
test
'
)
assert
{
'
var
'
:
'
test
'
,
'
opt1
'
:
'
oo
'
,
'
opt2
'
:
None
}
==
utils
.
extract_variables
(
'
{var}[_f{opt1}][_{opt2}]
'
,
'
test_foo
'
)
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