Skip to content
Snippets Groups Projects
Commit 22e0e18d authored by Nicolas  MAILLET's avatar Nicolas MAILLET
Browse files

Add tests for restricted_int

parent d3871113
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment