Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rpg
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
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
Nicolas MAILLET
rpg
Commits
22e0e18d
Commit
22e0e18d
authored
2 years ago
by
Nicolas MAILLET
Browse files
Options
Downloads
Patches
Plain Diff
Add tests for restricted_int
parent
d3871113
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_RapidPeptidesGenerator.py
+18
-0
18 additions, 0 deletions
tests/test_RapidPeptidesGenerator.py
with
18 additions
and
0 deletions
tests/test_RapidPeptidesGenerator.py
+
18
−
0
View file @
22e0e18d
...
...
@@ -45,6 +45,24 @@ def test_restricted_enzyme_id(capsys):
# Normal test
assert
RapidPeptidesGenerator
.
restricted_enzyme_id
(
"
asp-n
"
)
==
"
asp-n
"
def
test_restricted_int
(
capsys
):
"""
Test function
'
restricted_int(mc_val)
'"""
# Error test
with
pytest
.
raises
(
SystemExit
)
as
pytest_wrapped_e
:
RapidPeptidesGenerator
.
restricted_int
(
-
10
)
_
,
err
=
capsys
.
readouterr
()
assert
err
==
"
Value Error: miscleavage value should be greater then 0.
\n
"
assert
pytest_wrapped_e
.
type
==
SystemExit
assert
pytest_wrapped_e
.
value
.
code
==
1
with
pytest
.
raises
(
SystemExit
)
as
pytest_wrapped_e
:
RapidPeptidesGenerator
.
restricted_int
(
"
z
"
)
_
,
err
=
capsys
.
readouterr
()
assert
err
==
"
Type Error: miscleavage value should be an integer.
\n
"
assert
pytest_wrapped_e
.
type
==
SystemExit
assert
pytest_wrapped_e
.
value
.
code
==
1
# Normal test
assert
RapidPeptidesGenerator
.
restricted_int
(
3
)
==
3
def
test_list_enzyme
(
capsys
):
"""
Test function
'
list_enzyme()
'
This test should be run with empty user file
...
...
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