Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
panacota
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
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
Amandine PERRIN
panacota
Commits
1af96432
Commit
1af96432
authored
11 months ago
by
Amandine PERRIN
Browse files
Options
Downloads
Patches
Plain Diff
update tests
parent
58a2972c
No related branches found
No related tags found
No related merge requests found
Pipeline
#134994
canceled
11 months ago
Stage: test
Stage: coverage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/test_unit/test_pangenome/test_mmseq_func.py
+8
-8
8 additions, 8 deletions
test/test_unit/test_pangenome/test_mmseq_func.py
with
8 additions
and
8 deletions
test/test_unit/test_pangenome/test_mmseq_func.py
+
8
−
8
View file @
1af96432
...
@@ -50,6 +50,7 @@ def setup_teardown_module():
...
@@ -50,6 +50,7 @@ def setup_teardown_module():
os
.
remove
(
f
)
os
.
remove
(
f
)
print
(
"
teardown
"
)
print
(
"
teardown
"
)
# Clusters expected for the given databank (ref: [members]
# Clusters expected for the given databank (ref: [members]
EXP_CLUSTERS
=
{
"
GEN2.1017.00001.i0002_00004
"
:
[
"
GEN2.1017.00001.i0002_00004
"
,
EXP_CLUSTERS
=
{
"
GEN2.1017.00001.i0002_00004
"
:
[
"
GEN2.1017.00001.i0002_00004
"
,
"
GEN4.1111.00001.i0001_00002
"
,
"
GEN4.1111.00001.i0001_00002
"
,
...
@@ -232,7 +233,6 @@ def test_create_mmseqdb_not_all_exist(caplog):
...
@@ -232,7 +233,6 @@ def test_create_mmseqdb_not_all_exist(caplog):
assert
caplog
.
records
[
8
].
levelname
==
"
DETAIL
"
assert
caplog
.
records
[
8
].
levelname
==
"
DETAIL
"
def
test_do_mmseqdb_existok
(
caplog
):
def
test_do_mmseqdb_existok
(
caplog
):
"""
"""
Check that, when trying to run create_mmseqs_db while all output files already exist,
Check that, when trying to run create_mmseqs_db while all output files already exist,
...
@@ -250,12 +250,12 @@ def test_do_mmseqdb_existok(caplog):
...
@@ -250,12 +250,12 @@ def test_do_mmseqdb_existok(caplog):
# Check files created/existing
# Check files created/existing
for
file
in
[
filename
+
ext
for
ext
in
outext
]:
for
file
in
[
filename
+
ext
for
ext
in
outext
]:
assert
os
.
path
.
isfile
(
file
)
assert
os
.
path
.
isfile
(
file
)
assert
(
"
Creating database
"
)
in
caplog
.
text
#
assert ("Creating database") in caplog.text
assert
(
"
mmseqs database
"
assert
(
"
mmseqs database
"
"
test/data/pangenome/generated_by_unit-tests/test_create_mmseqsdb_exist.msdb
"
"
test/data/pangenome/generated_by_unit-tests/test_create_mmseqsdb_exist.msdb
"
"
already exists. The program will use it.
"
)
in
caplog
.
text
"
already exists. The program will use it.
"
)
in
caplog
.
text
assert
caplog
.
records
[
0
].
levelname
==
"
INFO
"
#
assert caplog.records[0].levelname == "INFO"
assert
caplog
.
records
[
1
].
levelname
==
"
WARNING
"
assert
caplog
.
records
[
0
].
levelname
==
"
WARNING
"
def
test_do_mmseqdb_quiet
(
caplog
):
def
test_do_mmseqdb_quiet
(
caplog
):
...
@@ -412,7 +412,7 @@ def test_mmseq2pan_givenout():
...
@@ -412,7 +412,7 @@ def test_mmseq2pan_givenout():
break
break
assert
found
assert
found
exp_pan
=
os
.
path
.
join
(
PATH_EXP_FILES
,
"
exp_pangenome-4genomes.lst
"
)
exp_pan
=
os
.
path
.
join
(
PATH_EXP_FILES
,
"
exp_pangenome-4genomes.lst
"
)
#Check that families written in output file are as expected
#
Check that families written in output file are as expected
with
open
(
exp_pan
,
"
r
"
)
as
ep
,
open
(
outfile
,
"
r
"
)
as
pan
:
with
open
(
exp_pan
,
"
r
"
)
as
ep
,
open
(
outfile
,
"
r
"
)
as
pan
:
lines_exp
=
[]
lines_exp
=
[]
lines_out
=
[]
lines_out
=
[]
...
@@ -593,7 +593,7 @@ def test_do_pangenome_justdone_panexists(caplog):
...
@@ -593,7 +593,7 @@ def test_do_pangenome_justdone_panexists(caplog):
-> removes mmseqs_clust to rerun it
-> removes mmseqs_clust to rerun it
-> check content of generated panfile
-> check content of generated panfile
"""
"""
caplog
.
set_level
(
15
)
# set level to detail
caplog
.
set_level
(
15
)
# set level to detail
outdir
=
os
.
path
.
join
(
GENEPATH
,
"
test_do_pangenome_outdir_exist
"
)
outdir
=
os
.
path
.
join
(
GENEPATH
,
"
test_do_pangenome_outdir_exist
"
)
prt_bank
=
"
exp_EXEM.All.prt
"
prt_bank
=
"
exp_EXEM.All.prt
"
mmseqdb
=
os
.
path
.
join
(
PATH_TEST_FILES
,
"
mmseq_db
"
)
mmseqdb
=
os
.
path
.
join
(
PATH_TEST_FILES
,
"
mmseq_db
"
)
...
@@ -626,7 +626,7 @@ def test_do_pangenome_justdone_panexists(caplog):
...
@@ -626,7 +626,7 @@ def test_do_pangenome_justdone_panexists(caplog):
found
=
True
found
=
True
break
break
assert
found
assert
found
# Check content of output pangenome file. Should contain families, and not empty
# Check content of output pangenome file. Should contain families, and not empty
# as it was before running do_pangenome
# as it was before running do_pangenome
exp_pan
=
os
.
path
.
join
(
PATH_EXP_FILES
,
"
exp_pangenome-4genomes.lst
"
)
exp_pan
=
os
.
path
.
join
(
PATH_EXP_FILES
,
"
exp_pangenome-4genomes.lst
"
)
with
open
(
exp_pan
,
"
r
"
)
as
ep
,
open
(
panfile
,
"
r
"
)
as
pan
:
with
open
(
exp_pan
,
"
r
"
)
as
ep
,
open
(
panfile
,
"
r
"
)
as
pan
:
...
@@ -947,7 +947,7 @@ def test_run_all_pangenome_panexists_wrong(caplog):
...
@@ -947,7 +947,7 @@ def test_run_all_pangenome_panexists_wrong(caplog):
open
(
panfile_out
,
"
w
"
).
close
()
open
(
panfile_out
,
"
w
"
).
close
()
with
pytest
.
raises
(
SystemExit
):
with
pytest
.
raises
(
SystemExit
):
mmseqs
.
run_all_pangenome
(
min_id
,
clust_mode
,
outdir
,
prt_path
,
mmseqs
.
run_all_pangenome
(
min_id
,
clust_mode
,
outdir
,
prt_path
,
threads
,
panfile
=
panfile
,
quiet
=
quiet
)
threads
,
panfile
=
panfile
,
quiet
=
quiet
)
# check that tmp dir was created and not empty
# check that tmp dir was created and not empty
tmp_dir
=
os
.
path
.
join
(
outdir
,
"
tmp_exp_EXEM.All.prt_0.8-mode1
"
)
tmp_dir
=
os
.
path
.
join
(
outdir
,
"
tmp_exp_EXEM.All.prt_0.8-mode1
"
)
...
...
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