Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hutspot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Klinische Genetica
capture-lumc
hutspot
Commits
817257ad
Commit
817257ad
authored
5 years ago
by
van den Berg
Browse files
Options
Downloads
Patches
Plain Diff
Add test code for stats output file
parent
edf39e9e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!13
Deprecate conda, make pipeline more general
Pipeline
#2783
failed
5 years ago
Stage: sanity
Stage: dry-run
Stage: integration
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_stats_output.py
+82
-0
82 additions, 0 deletions
tests/test_stats_output.py
with
82 additions
and
0 deletions
tests/test_stats_output.py
0 → 100644
+
82
−
0
View file @
817257ad
#!/usr/bin/env python
import
pathlib
import
pytest
import
os
@pytest.mark.workflow
(
name
=
'
test-integration-no-cluster
'
)
def
test_stats_file_exists
(
workflow_dir
):
stats_file
=
'
stats.tsv
'
full_path
=
workflow_dir
/
pathlib
.
Path
(
stats_file
)
assert
os
.
path
.
exists
(
full_path
)
@pytest.mark.workflow
(
name
=
'
test-integration-no-cluster
'
)
def
test_stats_file_name
(
workflow_dir
):
"""
Read in the stats file and do some tests
"""
stats_file
=
'
stats.tsv
'
full_path
=
workflow_dir
/
pathlib
.
Path
(
stats_file
)
# Since we only have two lines in the test stats file, this works
with
open
(
full_path
,
'
r
'
)
as
fin
:
header
=
next
(
fin
).
strip
().
split
(
'
\t
'
)
values
=
next
(
fin
).
strip
().
split
(
'
\t
'
)
data
=
dict
(
zip
(
header
,
values
))
assert
data
[
'
sample_name
'
]
==
'
micro
'
@pytest.mark.workflow
(
name
=
'
test-integration-no-cluster
'
)
def
test_stats_file_mapped_reads
(
workflow_dir
):
"""
Read in the stats file and do some tests
"""
stats_file
=
'
stats.tsv
'
full_path
=
workflow_dir
/
pathlib
.
Path
(
stats_file
)
# Since we only have two lines in the test stats file, this works
with
open
(
full_path
,
'
r
'
)
as
fin
:
header
=
next
(
fin
).
strip
().
split
(
'
\t
'
)
values
=
next
(
fin
).
strip
().
split
(
'
\t
'
)
data
=
dict
(
zip
(
header
,
values
))
assert
data
[
'
mapped_reads
'
]
==
'
15515
'
@pytest.mark.workflow
(
name
=
'
test-integration-no-cluster
'
)
def
test_stats_file_mapped_bases
(
workflow_dir
):
"""
Read in the stats file and do some tests
"""
stats_file
=
'
stats.tsv
'
full_path
=
workflow_dir
/
pathlib
.
Path
(
stats_file
)
# Since we only have two lines in the test stats file, this works
with
open
(
full_path
,
'
r
'
)
as
fin
:
header
=
next
(
fin
).
strip
().
split
(
'
\t
'
)
values
=
next
(
fin
).
strip
().
split
(
'
\t
'
)
data
=
dict
(
zip
(
header
,
values
))
assert
data
[
'
mapped_bases
'
]
==
'
2275114
'
@pytest.mark.workflow
(
name
=
'
test-integration-no-cluster
'
)
def
test_stats_file_usable_reads
(
workflow_dir
):
"""
Read in the stats file and do some tests
"""
stats_file
=
'
stats.tsv
'
full_path
=
workflow_dir
/
pathlib
.
Path
(
stats_file
)
# Since we only have two lines in the test stats file, this works
with
open
(
full_path
,
'
r
'
)
as
fin
:
header
=
next
(
fin
).
strip
().
split
(
'
\t
'
)
values
=
next
(
fin
).
strip
().
split
(
'
\t
'
)
data
=
dict
(
zip
(
header
,
values
))
assert
data
[
'
usable_reads
'
]
==
'
15477
'
@pytest.mark.workflow
(
name
=
'
test-integration-no-cluster
'
)
def
test_stats_file_usable_bases
(
workflow_dir
):
"""
Read in the stats file and do some tests
"""
stats_file
=
'
stats.tsv
'
full_path
=
workflow_dir
/
pathlib
.
Path
(
stats_file
)
# Since we only have two lines in the test stats file, this works
with
open
(
full_path
,
'
r
'
)
as
fin
:
header
=
next
(
fin
).
strip
().
split
(
'
\t
'
)
values
=
next
(
fin
).
strip
().
split
(
'
\t
'
)
data
=
dict
(
zip
(
header
,
values
))
assert
data
[
'
usable_bases
'
]
==
'
2270739
'
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