Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Klinische Genetica
prinia
Commits
a4da9b23
Commit
a4da9b23
authored
Sep 05, 2018
by
Sander Bollen
Browse files
add rudimentary testing
parent
e5a5710c
Changes
5
Hide whitespace changes
Inline
Side-by-side
prinia/utils.py
View file @
a4da9b23
...
...
@@ -48,7 +48,7 @@ def is_at_least_version_samtools(version_str, version_tupl):
:raises TypeError: if version_tupl contains non-integer
"""
regex
=
re
.
compile
(
'^(\d+)\.(\d+).*$'
)
if
"
_
"
not
in
version_str
:
if
"
"
not
in
version_str
:
match
=
regex
.
match
(
version_str
)
else
:
match
=
regex
.
match
(
version_str
.
split
(
" "
)[
-
1
])
...
...
requirements-dev.txt
0 → 100644
View file @
a4da9b23
flake8
pytest
pytest-cov
\ No newline at end of file
test/__init__.py
→
test
s
/__init__.py
View file @
a4da9b23
File moved
tests/test_utils.py
0 → 100644
View file @
a4da9b23
"""
test_utils.py
~~~~~~~~~~~~~
:copyright: (c) 2018 Sander Bollen
:copyright: (c) 2018 Leiden University Medical Center
:license: MIT
"""
import
pytest
from
prinia.utils
import
is_at_least_version_samtools
samtools_version_data
=
[
(
"1.9-33-g2d34e15"
,
(
1
,
3
),
True
),
(
"1.2-33-g2d34e15"
,
(
1
,
3
),
False
),
(
"1.9"
,
(
1
,
3
),
True
),
(
"1.2"
,
(
1
,
3
),
False
),
(
"samtools 1.9-33-g2d34e15"
,
(
1
,
3
),
True
),
(
"samtools 1.9"
,
(
1
,
3
),
True
),
(
"samtools 1.2"
,
(
1
,
3
),
False
)
]
@
pytest
.
mark
.
parametrize
(
"version_str, version_tupl, expected"
,
samtools_version_data
)
def
test_is_at_least_version_samtools
(
version_str
,
version_tupl
,
expected
):
val
=
is_at_least_version_samtools
(
version_str
,
version_tupl
)
assert
val
==
expected
tox.ini
0 → 100644
View file @
a4da9b23
[tox]
envlist
=
py27, py34
[testenv]
usedevelop
=
True
commands
=
# flake8 --statistics tests prinia
py.test
--cov
=
prinia --cov-report term-missing tests prinia
deps
=
-rrequirements.txt
-rrequirements-dev.txt
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment