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
Sean Fitzgibbon
fslpy
Commits
c68b8755
Commit
c68b8755
authored
Feb 25, 2020
by
Martin Craig
Committed by
Paul McCarthy
Apr 22, 2020
Browse files
Add a couple of simple tests for WSL run functionality
parent
dab1d398
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests/test_platform.py
View file @
c68b8755
...
...
@@ -212,3 +212,13 @@ def test_detect_ssh():
p
=
fslplatform
.
Platform
()
assert
not
p
.
inSSHSession
assert
not
p
.
inVNCSession
def
test_fslwsl
():
with
mock
.
patch
.
dict
(
'os.environ'
,
**
{
'FSLWSL'
:
'1'
}):
p
=
fslplatform
.
Platform
()
assert
p
.
fslwsl
with
mock
.
patch
.
dict
(
'os.environ'
,
**
{
'FSLWSL'
:
'0'
}):
p
=
fslplatform
.
Platform
()
assert
not
p
.
fslwsl
tests/test_run.py
View file @
c68b8755
...
...
@@ -410,3 +410,7 @@ def test_run_logcmd():
assert
stdout
==
expstdout
assert
open
(
'my_stdout'
,
'rt'
).
read
()
==
expcmd
+
expstdout
def
test_wslpath
():
assert
run
.
wslpath
(
'c:
\\
Users
\\
Fishcake
\\
image.nii.gz'
)
==
'/mnt/c/Users/Fishcake/image.nii.gz'
assert
run
.
wslpath
(
'--input=x:
\\
transfers
\\
scratch
\\
image_2.nii'
)
==
'--input=/mnt/x/transfers/scratch/image_2.nii'
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