Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Michiel Cottaar
fslpy
Commits
c68b8755
Commit
c68b8755
authored
5 years ago
by
Martin Craig
Committed by
Paul McCarthy
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add a couple of simple tests for WSL run functionality
parent
dab1d398
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/test_platform.py
+10
-0
10 additions, 0 deletions
tests/test_platform.py
tests/test_run.py
+4
-0
4 additions, 0 deletions
tests/test_run.py
with
14 additions
and
0 deletions
tests/test_platform.py
+
10
−
0
View file @
c68b8755
...
@@ -212,3 +212,13 @@ def test_detect_ssh():
...
@@ -212,3 +212,13 @@ def test_detect_ssh():
p
=
fslplatform
.
Platform
()
p
=
fslplatform
.
Platform
()
assert
not
p
.
inSSHSession
assert
not
p
.
inSSHSession
assert
not
p
.
inVNCSession
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
This diff is collapsed.
Click to expand it.
tests/test_run.py
+
4
−
0
View file @
c68b8755
...
@@ -410,3 +410,7 @@ def test_run_logcmd():
...
@@ -410,3 +410,7 @@ def test_run_logcmd():
assert
stdout
==
expstdout
assert
stdout
==
expstdout
assert
open
(
'
my_stdout
'
,
'
rt
'
).
read
()
==
expcmd
+
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
'
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