Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Terminal fragment selector
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
zavolan_group
tools
Terminal fragment selector
Commits
cbf2077d
Commit
cbf2077d
authored
2 years ago
by
Hugo Madge Leon
Browse files
Options
Downloads
Patches
Plain Diff
CLI + complete linting & coverage
parent
dd65166d
No related branches found
No related tags found
3 merge requests
!45
Hugo new
,
!41
I still don't know how this works
,
!40
CI/CD, tests, and complete linting
Pipeline
#14865
failed
2 years ago
Stage: build
Stage: test
Changes
22
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/test_frag.py
+8
-8
8 additions, 8 deletions
tests/test_frag.py
tests/test_utils.py
+6
-5
6 additions, 5 deletions
tests/test_utils.py
with
14 additions
and
13 deletions
tests/test_frag.py
+
8
−
8
View file @
cbf2077d
...
...
@@ -2,19 +2,19 @@
import
pytest
from
Bio
import
SeqIO
from
term_frag_sel.fragmentation
import
fragmentation
from
term_frag_sel.fragmentation
import
fragmentation
# type: ignore
with
open
(
"
.
/test_files/test.fasta
"
,
"
r
"
)
as
handle
:
with
open
(
"
tests
/test_files/test.fasta
"
,
"
r
"
,
encoding
=
"
utf-8
"
)
as
handle
:
fasta
=
SeqIO
.
parse
(
handle
,
"
fasta
"
)
# have to create the counts file
mu
=
100
std
=
10
a_prob
=
0.22
c_prob
=
0.28
t_prob
=
0.25
g_prob
=
0.25
MU
=
100
STD
=
10
A_PROB
=
0.22
C_PROB
=
0.28
T_PROB
=
0.25
G_PROB
=
0.25
def
test_frag
():
...
...
This diff is collapsed.
Click to expand it.
tests/test_utils.py
+
6
−
5
View file @
cbf2077d
"""
Test utils.py functions.
"""
import
pytest
import
argparse
import
pytest
from
term_frag_sel.utils
import
check_positive
,
check_prob
from
term_frag_sel.utils
import
check_positive
,
check_prob
# type: ignore
def
test_positive
():
"""
Test check_positive function.
"""
assert
check_positive
(
"
1
"
)
==
1
assert
check_positive
(
"
100
"
)
==
100
assert
check_positive
(
"
0
"
)
==
100
assert
check_positive
(
"
2.2
"
)
==
2
assert
check_positive
(
"
2.6
"
)
==
3
with
pytest
.
raises
(
argparse
.
ArgumentTypeError
):
check_positive
(
"
0
"
)
with
pytest
.
raises
(
argparse
.
ArgumentTypeError
):
check_positive
(
"
-1
"
)
with
pytest
.
raises
(
argparse
.
ArgumentTypeError
):
...
...
@@ -30,7 +31,7 @@ def test_prob():
check_prob
(
"
10
"
)
with
pytest
.
raises
(
argparse
.
ArgumentTypeError
):
check_prob
(
"
-1
"
)
with
pytest
.
raises
(
argparse
.
ArgumentTyp
eError
):
with
pytest
.
raises
(
Valu
eError
):
check_prob
(
"
string
"
)
with
pytest
.
raises
(
argparse
.
ArgumentTyp
eError
):
with
pytest
.
raises
(
Valu
eError
):
check_prob
(
""
)
This diff is collapsed.
Click to expand it.
Prev
1
2
Next
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