Skip to content
Snippets Groups Projects
Commit cbf2077d authored by Hugo Madge Leon's avatar Hugo Madge Leon
Browse files

CLI + complete linting & coverage

parent dd65166d
No related branches found
No related tags found
3 merge requests!45Hugo new,!41I still don't know how this works,!40CI/CD, tests, and complete linting
Pipeline #14865 failed
......@@ -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():
......
"""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.ArgumentTypeError):
with pytest.raises(ValueError):
check_prob("string")
with pytest.raises(argparse.ArgumentTypeError):
with pytest.raises(ValueError):
check_prob("")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment