Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FSL
fslpy
Commits
5329ccaa
Commit
5329ccaa
authored
Feb 26, 2020
by
Michiel Cottaar
Committed by
Paul McCarthy
Feb 27, 2020
Browse files
BUG: actually test the stated bug
I think these tests would have failed before refactoring
parent
3322e68a
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/test_filetree/test_template.py
View file @
5329ccaa
...
...
@@ -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'
)
with
pytest
.
raises
(
ValueError
):
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'
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment