From 44cd2b31c757fd8d773d2adc93a46c5db56d91bd Mon Sep 17 00:00:00 2001 From: Martijn Vermaat <martijn@vermaat.name> Date: Thu, 8 Oct 2015 15:14:30 +0200 Subject: [PATCH] Add tests for ncbi module --- tests/test_ncbi.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 tests/test_ncbi.py diff --git a/tests/test_ncbi.py b/tests/test_ncbi.py new file mode 100644 index 00000000..c8df1c67 --- /dev/null +++ b/tests/test_ncbi.py @@ -0,0 +1,37 @@ +""" +Tests for the mutalyzer.ncbi module. +""" + + +from __future__ import unicode_literals + +import pytest + +from mutalyzer import ncbi + + +pytestmark = [ + pytest.mark.usefixtures('references'), + pytest.mark.parametrize('references', [['MARK1']], indirect=True) +] + + +def test_transcript_to_protein(): + """ + Get protein for transcript. + """ + assert ncbi.transcript_to_protein('NM_018650') == 'NP_061120' + + +def test_transcript_to_protein_negative(): + """ + Get no protein for transcript. + """ + assert ncbi.transcript_to_protein('XM_005273133') is None + + +def test_protein_to_transcript(): + """ + Get transcript for protein. + """ + assert ncbi.protein_to_transcript('NP_061120') == 'NM_018650' -- GitLab