Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
concepts-processing
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Package registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
meldb
concepts-processing
Commits
62c283c7
Commit
62c283c7
authored
4 months ago
by
mjbonifa
Browse files
Options
Downloads
Patches
Plain Diff
changed acmc.py to main.py, convention for cli tool
parent
74fe2c40
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_acmc.py
+17
-17
17 additions, 17 deletions
tests/test_acmc.py
with
17 additions
and
17 deletions
tests/test_acmc.py
+
17
−
17
View file @
62c283c7
...
@@ -8,7 +8,7 @@ from pathlib import Path
...
@@ -8,7 +8,7 @@ from pathlib import Path
import
trud
import
trud
import
omop
import
omop
import
phen
import
phen
import
acmc
import
main
# setup logging
# setup logging
from
logging_config
import
setup_logger
from
logging_config
import
setup_logger
...
@@ -35,29 +35,29 @@ def logger():
...
@@ -35,29 +35,29 @@ def logger():
def
test_phen_init_local_default
(
tmp_dir
,
monkeypatch
,
caplog
):
def
test_phen_init_local_default
(
tmp_dir
,
monkeypatch
,
caplog
):
with
caplog
.
at_level
(
logging
.
DEBUG
):
with
caplog
.
at_level
(
logging
.
DEBUG
):
monkeypatch
.
setattr
(
sys
,
"
argv
"
,
[
"
acmc
.py
"
,
"
phen
"
,
"
init
"
])
monkeypatch
.
setattr
(
sys
,
"
argv
"
,
[
"
main
.py
"
,
"
phen
"
,
"
init
"
])
# Mock input() to return "yes" to the question about reinitialising the directory
# Mock input() to return "yes" to the question about reinitialising the directory
monkeypatch
.
setattr
(
"
builtins.input
"
,
lambda
_
:
"
y
"
)
monkeypatch
.
setattr
(
"
builtins.input
"
,
lambda
_
:
"
y
"
)
acmc
.
main
()
main
.
main
()
assert
"
Phenotype initialised successfully
"
in
caplog
.
text
assert
"
Phenotype initialised successfully
"
in
caplog
.
text
def
test_phen_init_local_specified
(
tmp_dir
,
monkeypatch
,
caplog
):
def
test_phen_init_local_specified
(
tmp_dir
,
monkeypatch
,
caplog
):
with
caplog
.
at_level
(
logging
.
DEBUG
):
with
caplog
.
at_level
(
logging
.
DEBUG
):
phen_path
=
tmp_dir
/
"
phen
"
phen_path
=
tmp_dir
/
"
phen
"
monkeypatch
.
setattr
(
sys
,
"
argv
"
,
[
"
acmc
.py
"
,
"
phen
"
,
"
init
"
,
"
-d
"
,
str
(
phen_path
.
resolve
())])
monkeypatch
.
setattr
(
sys
,
"
argv
"
,
[
"
main
.py
"
,
"
phen
"
,
"
init
"
,
"
-d
"
,
str
(
phen_path
.
resolve
())])
# Mock input() to return "yes" to the question about reinitialising the directory
# Mock input() to return "yes" to the question about reinitialising the directory
monkeypatch
.
setattr
(
"
builtins.input
"
,
lambda
_
:
"
y
"
)
monkeypatch
.
setattr
(
"
builtins.input
"
,
lambda
_
:
"
y
"
)
acmc
.
main
()
main
.
main
()
assert
"
Phenotype initialised successfully
"
in
caplog
.
text
assert
"
Phenotype initialised successfully
"
in
caplog
.
text
def
test_phen_workflow
(
tmp_dir
,
monkeypatch
,
caplog
):
def
test_phen_workflow
(
tmp_dir
,
monkeypatch
,
caplog
):
with
caplog
.
at_level
(
logging
.
DEBUG
):
with
caplog
.
at_level
(
logging
.
DEBUG
):
phen_path
=
tmp_dir
/
"
phen
"
phen_path
=
tmp_dir
/
"
phen
"
phen_path
=
phen_path
.
resolve
()
phen_path
=
phen_path
.
resolve
()
monkeypatch
.
setattr
(
sys
,
"
argv
"
,
[
"
acmc
.py
"
,
"
phen
"
,
"
init
"
,
"
-d
"
,
str
(
phen_path
.
resolve
())])
monkeypatch
.
setattr
(
sys
,
"
argv
"
,
[
"
main
.py
"
,
"
phen
"
,
"
init
"
,
"
-d
"
,
str
(
phen_path
.
resolve
())])
# Mock input() to return "yes" to the question about reinitialising the directory
# Mock input() to return "yes" to the question about reinitialising the directory
monkeypatch
.
setattr
(
"
builtins.input
"
,
lambda
_
:
"
y
"
)
monkeypatch
.
setattr
(
"
builtins.input
"
,
lambda
_
:
"
y
"
)
acmc
.
main
()
main
.
main
()
assert
"
Phenotype initialised successfully
"
in
caplog
.
text
assert
"
Phenotype initialised successfully
"
in
caplog
.
text
with
caplog
.
at_level
(
logging
.
DEBUG
):
with
caplog
.
at_level
(
logging
.
DEBUG
):
...
@@ -74,31 +74,31 @@ def test_phen_workflow(tmp_dir, monkeypatch, caplog):
...
@@ -74,31 +74,31 @@ def test_phen_workflow(tmp_dir, monkeypatch, caplog):
shutil
.
copy
(
source
,
destination
)
shutil
.
copy
(
source
,
destination
)
shutil
.
copy
(
phen_path
/
'
config1.json
'
,
phen_path
/
'
config.json
'
)
shutil
.
copy
(
phen_path
/
'
config1.json
'
,
phen_path
/
'
config.json
'
)
monkeypatch
.
setattr
(
sys
,
"
argv
"
,
[
"
acmc
.py
"
,
"
phen
"
,
"
validate
"
,
"
-d
"
,
str
(
phen_path
.
resolve
())])
monkeypatch
.
setattr
(
sys
,
"
argv
"
,
[
"
main
.py
"
,
"
phen
"
,
"
validate
"
,
"
-d
"
,
str
(
phen_path
.
resolve
())])
acmc
.
main
()
main
.
main
()
assert
"
Phenotype validated successfully
"
in
caplog
.
text
assert
"
Phenotype validated successfully
"
in
caplog
.
text
# map phenotype
# map phenotype
with
caplog
.
at_level
(
logging
.
DEBUG
):
with
caplog
.
at_level
(
logging
.
DEBUG
):
monkeypatch
.
setattr
(
sys
,
"
argv
"
,
[
"
acmc
.py
"
,
"
phen
"
,
"
map
"
,
"
-d
"
,
str
(
phen_path
.
resolve
()),
"
-t
"
,
"
read2
"
,
"
-tr
"
,
"
-ve
"
])
monkeypatch
.
setattr
(
sys
,
"
argv
"
,
[
"
main
.py
"
,
"
phen
"
,
"
map
"
,
"
-d
"
,
str
(
phen_path
.
resolve
()),
"
-t
"
,
"
read2
"
,
"
-tr
"
,
"
-ve
"
])
acmc
.
main
()
main
.
main
()
assert
"
Phenotype processed successfully
"
in
caplog
.
text
assert
"
Phenotype processed successfully
"
in
caplog
.
text
# publish phenotype
# publish phenotype
with
caplog
.
at_level
(
logging
.
DEBUG
):
with
caplog
.
at_level
(
logging
.
DEBUG
):
monkeypatch
.
setattr
(
sys
,
"
argv
"
,
[
"
acmc
.py
"
,
"
phen
"
,
"
publish
"
,
"
-d
"
,
str
(
phen_path
.
resolve
())])
monkeypatch
.
setattr
(
sys
,
"
argv
"
,
[
"
main
.py
"
,
"
phen
"
,
"
publish
"
,
"
-d
"
,
str
(
phen_path
.
resolve
())])
acmc
.
main
()
main
.
main
()
assert
"
Phenotype published successfully
"
in
caplog
.
text
assert
"
Phenotype published successfully
"
in
caplog
.
text
# copy phenotype'
# copy phenotype'
with
caplog
.
at_level
(
logging
.
DEBUG
):
with
caplog
.
at_level
(
logging
.
DEBUG
):
monkeypatch
.
setattr
(
sys
,
"
argv
"
,
[
"
acmc
.py
"
,
"
phen
"
,
"
copy
"
,
"
-d
"
,
str
(
phen_path
.
resolve
()),
"
-td
"
,
str
(
tmp_dir
.
resolve
()),
"
-v
"
,
"
v1.0.3
"
])
monkeypatch
.
setattr
(
sys
,
"
argv
"
,
[
"
main
.py
"
,
"
phen
"
,
"
copy
"
,
"
-d
"
,
str
(
phen_path
.
resolve
()),
"
-td
"
,
str
(
tmp_dir
.
resolve
()),
"
-v
"
,
"
v1.0.3
"
])
acmc
.
main
()
main
.
main
()
assert
"
Phenotype copied successfully
"
in
caplog
.
text
assert
"
Phenotype copied successfully
"
in
caplog
.
text
# diff phenotype
# diff phenotype
with
caplog
.
at_level
(
logging
.
DEBUG
):
with
caplog
.
at_level
(
logging
.
DEBUG
):
old_path
=
tmp_dir
/
"
v1.0.3
"
old_path
=
tmp_dir
/
"
v1.0.3
"
monkeypatch
.
setattr
(
sys
,
"
argv
"
,
[
"
acmc
.py
"
,
"
phen
"
,
"
diff
"
,
"
-d
"
,
str
(
phen_path
.
resolve
()),
"
-old
"
,
str
(
old_path
.
resolve
())])
monkeypatch
.
setattr
(
sys
,
"
argv
"
,
[
"
main
.py
"
,
"
phen
"
,
"
diff
"
,
"
-d
"
,
str
(
phen_path
.
resolve
()),
"
-old
"
,
str
(
old_path
.
resolve
())])
acmc
.
main
()
main
.
main
()
assert
"
Phenotypes diff
'
d successfully
"
in
caplog
.
text
assert
"
Phenotypes diff
'
d successfully
"
in
caplog
.
text
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