From e6f19d1cd7b274095505020bf0d5093c4a752e74 Mon Sep 17 00:00:00 2001 From: Martijn Vermaat <martijn@vermaat.name> Date: Mon, 21 Jul 2014 15:03:26 +0200 Subject: [PATCH] Move from nose to pytest for unit tests See http://pytest.org/ --- doc/development.rst | 4 +- doc/install.rst | 10 +- requirements.txt | 2 +- tests/test_crossmap.py | 217 +++++++++++---------- tests/test_describe.py | 9 +- tests/test_grammar.py | 3 +- tests/test_mapping.py | 47 +++-- tests/test_mutator.py | 261 +++++++++++++------------ tests/test_parsers_genbank.py | 3 +- tests/test_scheduler.py | 8 +- tests/test_services_json.py | 17 +- tests/test_services_soap.py | 212 ++++++++++---------- tests/test_variantchecker.py | 351 ++++++++++++++-------------------- tests/test_website.py | 35 ++-- 14 files changed, 546 insertions(+), 633 deletions(-) diff --git a/doc/development.rst b/doc/development.rst index 310a3a62..315db3c8 100644 --- a/doc/development.rst +++ b/doc/development.rst @@ -27,7 +27,7 @@ In general, try to follow the `PEP 8`_ guidelines for Python code and `PEP Unit tests ---------- -To run the unit tests with `nose`_, just run ``nosetests -v``. +To run the unit tests with `pytest`_, just run ``py.test``. Working with feature branches @@ -128,7 +128,7 @@ Releasing a new version is done as follows: git commit -am 'Open development for X.Y.Z+1' -.. _nose: https://nose.readthedocs.org/ +.. _pytest: http://pytest.org/ .. _PEP 8: http://www.python.org/dev/peps/pep-0008/ .. _PEP 257: http://www.python.org/dev/peps/pep-0257/ .. _SemVer: http://semver.org/ diff --git a/doc/install.rst b/doc/install.rst index a3444dc4..ab615afb 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -103,11 +103,7 @@ install all required Python packages:: $ sudo apt-get install python-dev libmysqlclient-dev libxml2-dev libxslt-dev $ pip install -r requirements.txt -Now might be a good time to run the unit tests:: - - $ nosetests -v - -If everything's okay, install Mutalyzer:: +Install Mutalyzer:: $ python setup.py install @@ -120,6 +116,10 @@ If everything's okay, install Mutalyzer:: only links from the installation directory to the source code such that any changes you make to it are directly available in the environment. +Now might be a good time to run the unit tests:: + + $ py.test + .. seealso:: `virtualenv`_ diff --git a/requirements.txt b/requirements.txt index 1add561a..dc3e7ac8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ MySQL-python==1.2.5 biopython==1.63 lxml==3.3.3 -nose==1.3.0 +pytest==2.6.1 pyparsing==2.0.1 pytz==2013.9 requests==2.2.1 diff --git a/tests/test_crossmap.py b/tests/test_crossmap.py index d1500999..ff9d6d75 100644 --- a/tests/test_crossmap.py +++ b/tests/test_crossmap.py @@ -4,7 +4,6 @@ Tests for the Crossmap module. #import logging; logging.basicConfig() -from nose.tools import * from mutalyzer.Crossmap import Crossmap @@ -24,9 +23,9 @@ class TestCrossmap(MutalyzerTest): 103528, 119465, 119537, 144687, 144810, 148418, 149215] cds = [27925, 74736] cm = Crossmap(rna, cds, 1) - assert_equal(cm._Crossmap__crossmapping, - [-304, -181, -180, 15, 16, 117, 118, 205, 206, 325, 326, - 398, 399, 522, 523, 1320]) + assert (cm._Crossmap__crossmapping == + [-304, -181, -180, 15, 16, 117, 118, 205, 206, 325, 326, 398, + 399, 522, 523, 1320]) def test_splice_sites_reverse(self): """ @@ -37,9 +36,9 @@ class TestCrossmap(MutalyzerTest): 76535, 92453, 92554, 123276, 123470, 146090, 146213] cds = [76479, 123290] cm = Crossmap(rna, cds, -1) - assert_equal(cm._Crossmap__crossmapping, - [1320, 523, 522, 399, 398, 326, 325, 206, 205, 118, 117, - 16, 15, -180, -181, -304]) + assert (cm._Crossmap__crossmapping == + [1320, 523, 522, 399, 398, 326, 325, 206, 205, 118, 117, 16, + 15, -180, -181, -304]) def test_g2x(self): """ @@ -51,20 +50,20 @@ class TestCrossmap(MutalyzerTest): cds = [27925, 74736] cm = Crossmap(rna, cds, 1) # Fix for r536: disable the -u and +d convention. - #assert_equal(cm.tuple2string(cm.g2x(5001)), '-304-u1') - assert_equal(cm.tuple2string(cm.g2x(5001)), '-305') - assert_equal(cm.tuple2string(cm.g2x(5124)), '-182') - assert_equal(cm.tuple2string(cm.g2x(5126)), '-181+1') - assert_equal(cm.tuple2string(cm.g2x(27924)), '-1') - assert_equal(cm.tuple2string(cm.g2x(27925)), '1') - assert_equal(cm.tuple2string(cm.g2x(58660)), '16-1') - assert_equal(cm.tuple2string(cm.g2x(74736)), '174') - assert_equal(cm.tuple2string(cm.g2x(74737)), '*1') - assert_equal(cm.tuple2string(cm.g2x(103408)), '*32-1') - assert_equal(cm.tuple2string(cm.g2x(103410)), '*33') + #assert cm.tuple2string(cm.g2x(5001)) == '-304-u1' + assert cm.tuple2string(cm.g2x(5001)) == '-305' + assert cm.tuple2string(cm.g2x(5124)) == '-182' + assert cm.tuple2string(cm.g2x(5126)) == '-181+1' + assert cm.tuple2string(cm.g2x(27924)) == '-1' + assert cm.tuple2string(cm.g2x(27925)) == '1' + assert cm.tuple2string(cm.g2x(58660)) == '16-1' + assert cm.tuple2string(cm.g2x(74736)) == '174' + assert cm.tuple2string(cm.g2x(74737)) == '*1' + assert cm.tuple2string(cm.g2x(103408)) == '*32-1' + assert cm.tuple2string(cm.g2x(103410)) == '*33' # Fix for r536: disable the -u and +d convention. - #assert_equal(cm.tuple2string(cm.g2x(149216)), '*1146+d1') - assert_equal(cm.tuple2string(cm.g2x(149216)), '*1147') + #assert cm.tuple2string(cm.g2x(149216)) == '*1146+d1' + assert cm.tuple2string(cm.g2x(149216)) == '*1147' def test_g2x_reverse(self): """ @@ -76,20 +75,20 @@ class TestCrossmap(MutalyzerTest): cds = [76479, 123290] cm = Crossmap(rna, cds, -1) # Fix for r536: disable the -u and +d convention. - #assert_equal(cm.tuple2string(cm.g2x(146214)), '-304-u1') - assert_equal(cm.tuple2string(cm.g2x(146214)), '-305') - assert_equal(cm.tuple2string(cm.g2x(146091)), '-182') - assert_equal(cm.tuple2string(cm.g2x(146089)), '-181+1') - assert_equal(cm.tuple2string(cm.g2x(123291)), '-1') - assert_equal(cm.tuple2string(cm.g2x(123290)), '1') - assert_equal(cm.tuple2string(cm.g2x(92555)), '16-1') - assert_equal(cm.tuple2string(cm.g2x(76479)), '174') - assert_equal(cm.tuple2string(cm.g2x(76478)), '*1') - assert_equal(cm.tuple2string(cm.g2x(47807)), '*32-1') - assert_equal(cm.tuple2string(cm.g2x(47805)), '*33') + #assert cm.tuple2string(cm.g2x(146214)) == '-304-u1' + assert cm.tuple2string(cm.g2x(146214)) == '-305' + assert cm.tuple2string(cm.g2x(146091)) == '-182' + assert cm.tuple2string(cm.g2x(146089)) == '-181+1' + assert cm.tuple2string(cm.g2x(123291)) == '-1' + assert cm.tuple2string(cm.g2x(123290)) == '1' + assert cm.tuple2string(cm.g2x(92555)) == '16-1' + assert cm.tuple2string(cm.g2x(76479)) == '174' + assert cm.tuple2string(cm.g2x(76478)) == '*1' + assert cm.tuple2string(cm.g2x(47807)) == '*32-1' + assert cm.tuple2string(cm.g2x(47805)) == '*33' # Fix for r536: disable the -u and +d convention. - #assert_equal(cm.tuple2string(cm.g2x(1999)), '*1146+d1') - assert_equal(cm.tuple2string(cm.g2x(1999)), '*1147') + #assert cm.tuple2string(cm.g2x(1999)) == '*1146+d1' + assert cm.tuple2string(cm.g2x(1999)) == '*1147' def test_x2g_more(self): """ @@ -100,17 +99,17 @@ class TestCrossmap(MutalyzerTest): 103528, 119465, 119537, 144687, 144810, 148418, 149215] cds = [27925, 74736] cm = Crossmap(rna, cds, 1) - assert_equal(cm.x2g(-304, -1), 5001) - assert_equal(cm.x2g(-182, 0), 5124) - assert_equal(cm.x2g(-181, 1), 5126) - assert_equal(cm.x2g(-1, 0), 27924) - assert_equal(cm.x2g(1, 0), 27925) - assert_equal(cm.x2g(16, -1), 58660) - assert_equal(cm.x2g(174, 0), 74736) - assert_equal(cm.x2g(cm.main2int('*1'), 0), 74737) - assert_equal(cm.x2g(cm.main2int('*32'), -1), 103408) - assert_equal(cm.x2g(cm.main2int('*33'), 0), 103410) - assert_equal(cm.x2g(cm.main2int('*1146'), 1), 149216) + assert cm.x2g(-304, -1) == 5001 + assert cm.x2g(-182, 0) == 5124 + assert cm.x2g(-181, 1) == 5126 + assert cm.x2g(-1, 0) == 27924 + assert cm.x2g(1, 0) == 27925 + assert cm.x2g(16, -1) == 58660 + assert cm.x2g(174, 0) == 74736 + assert cm.x2g(cm.main2int('*1'), 0) == 74737 + assert cm.x2g(cm.main2int('*32'), -1) == 103408 + assert cm.x2g(cm.main2int('*33'), 0) == 103410 + assert cm.x2g(cm.main2int('*1146'), 1) == 149216 def test_x2g_more_reverse(self): """ @@ -121,17 +120,17 @@ class TestCrossmap(MutalyzerTest): 76535, 92453, 92554, 123276, 123470, 146090, 146213] cds = [76479, 123290] cm = Crossmap(rna, cds, -1) - assert_equal(cm.x2g(-304, -1), 146214) - assert_equal(cm.x2g(-182, 0), 146091) - assert_equal(cm.x2g(-181, 1), 146089) - assert_equal(cm.x2g(-1, 0), 123291) - assert_equal(cm.x2g(1, 0), 123290) - assert_equal(cm.x2g(16, -1), 92555) - assert_equal(cm.x2g(174, 0), 76479) - assert_equal(cm.x2g(cm.main2int('*1'), 0), 76478) - assert_equal(cm.x2g(cm.main2int('*32'), -1), 47807) - assert_equal(cm.x2g(cm.main2int('*33'), 0), 47805) - assert_equal(cm.x2g(cm.main2int('*1146'), 1), 1999) + assert cm.x2g(-304, -1) == 146214 + assert cm.x2g(-182, 0) == 146091 + assert cm.x2g(-181, 1) == 146089 + assert cm.x2g(-1, 0) == 123291 + assert cm.x2g(1, 0) == 123290 + assert cm.x2g(16, -1) == 92555 + assert cm.x2g(174, 0) == 76479 + assert cm.x2g(cm.main2int('*1'), 0) == 76478 + assert cm.x2g(cm.main2int('*32'), -1) == 47807 + assert cm.x2g(cm.main2int('*33'), 0) == 47805 + assert cm.x2g(cm.main2int('*1146'), 1) == 1999 def test_g2x_missing_exons(self): """ @@ -145,7 +144,7 @@ class TestCrossmap(MutalyzerTest): cds = [27925, 74736] cm1 = Crossmap(rna1, cds, 1) cm2 = Crossmap(rna2, cds, 1) - assert_equal(cm1.g2x(27925), cm2.g2x(27925)) + assert cm1.g2x(27925) == cm2.g2x(27925) def test_g2x_missing_exons_reverse(self): """ @@ -160,7 +159,7 @@ class TestCrossmap(MutalyzerTest): cds = [76479, 123290] cm1 = Crossmap(rna1, cds, -1) cm2 = Crossmap(rna2, cds, -1) - assert_equal(cm1.g2x(123290), cm2.g2x(123290)) + assert cm1.g2x(123290) == cm2.g2x(123290) def test_splice_sites_noncoding(self): """ @@ -170,9 +169,9 @@ class TestCrossmap(MutalyzerTest): rna = [5002, 5125, 27745, 27939, 58661, 58762, 74680, 74767, 103409, 103528, 119465, 119537, 144687, 144810, 148418, 149215] cm = Crossmap(rna, [], 1) - assert_equal(cm._Crossmap__crossmapping, - [1, 124, 125, 319, 320, 421, 422, 509, 510, 629, 630, - 702, 703, 826, 827, 1624]) + assert (cm._Crossmap__crossmapping == + [1, 124, 125, 319, 320, 421, 422, 509, 510, 629, 630, 702, + 703, 826, 827, 1624]) def test_splice_sites_noncoding_reverse(self): """ @@ -182,9 +181,9 @@ class TestCrossmap(MutalyzerTest): rna = [2000, 2797, 6405, 6528, 31678, 31750, 47687, 47806, 76448, 76535, 92453, 92554, 123276, 123470, 146090, 146213] cm = Crossmap(rna, [], -1) - assert_equal(cm._Crossmap__crossmapping, - [1624, 827, 826, 703, 702, 630, 629, 510, 509, 422, 421, - 320, 319, 125, 124, 1]) + assert (cm._Crossmap__crossmapping == + [1624, 827, 826, 703, 702, 630, 629, 510, 509, 422, 421, 320, + 319, 125, 124, 1]) def test_g2x_noncoding(self): """ @@ -195,13 +194,13 @@ class TestCrossmap(MutalyzerTest): 103528, 119465, 119537, 144687, 144810, 148418, 149215] cm = Crossmap(rna, [], 1) # Fix for r536: disable the -u and +d convention. - #assert_equal(cm.tuple2string(cm.g2x(5001)), '1-u1') - assert_equal(cm.tuple2string(cm.g2x(5001)), '-1') - assert_equal(cm.tuple2string(cm.g2x(5002)), '1') - assert_equal(cm.tuple2string(cm.g2x(5126)), '124+1') + #assert cm.tuple2string(cm.g2x(5001)) == '1-u1' + assert cm.tuple2string(cm.g2x(5001)) == '-1' + assert cm.tuple2string(cm.g2x(5002)) == '1' + assert cm.tuple2string(cm.g2x(5126)) == '124+1' # Fix for r536: disable the -u and +d convention. - #assert_equal(cm.tuple2string(cm.g2x(149216)), '1624+d1') - assert_equal(cm.tuple2string(cm.g2x(149216)), '*1') + #assert cm.tuple2string(cm.g2x(149216)) == '1624+d1' + assert cm.tuple2string(cm.g2x(149216)) == '*1' def test_g2x_noncoding_reverse(self): """ @@ -212,13 +211,13 @@ class TestCrossmap(MutalyzerTest): 76535, 92453, 92554, 123276, 123470, 146090, 146213] cm = Crossmap(rna, [], -1) # Fix for r536: disable the -u and +d convention. - #assert_equal(cm.tuple2string(cm.g2x(146214)), '1-u1') - assert_equal(cm.tuple2string(cm.g2x(146214)), '-1') - assert_equal(cm.tuple2string(cm.g2x(146213)), '1') - assert_equal(cm.tuple2string(cm.g2x(146089)), '124+1') + #assert cm.tuple2string(cm.g2x(146214)) == '1-u1' + assert cm.tuple2string(cm.g2x(146214)) == '-1' + assert cm.tuple2string(cm.g2x(146213)) == '1' + assert cm.tuple2string(cm.g2x(146089)) == '124+1' # Fix for r536: disable the -u and +d convention. - #assert_equal(cm.tuple2string(cm.g2x(1999)), '1624+d1') - assert_equal(cm.tuple2string(cm.g2x(1999)), '*1') + #assert cm.tuple2string(cm.g2x(1999)) == '1624+d1' + assert cm.tuple2string(cm.g2x(1999)) == '*1' def test_x2g_noncoding(self): """ @@ -228,10 +227,10 @@ class TestCrossmap(MutalyzerTest): rna = [5002, 5125, 27745, 27939, 58661, 58762, 74680, 74767, 103409, 103528, 119465, 119537, 144687, 144810, 148418, 149215] cm = Crossmap(rna, [], 1) - assert_equal(cm.x2g(1, -1), 5001) - assert_equal(cm.x2g(1, 0), 5002) - assert_equal(cm.x2g(124, 1), 5126) - assert_equal(cm.x2g(1624, 1), 149216) + assert cm.x2g(1, -1) == 5001 + assert cm.x2g(1, 0) == 5002 + assert cm.x2g(124, 1) == 5126 + assert cm.x2g(1624, 1) == 149216 def test_x2g_noncoding_reverse(self): """ @@ -241,10 +240,10 @@ class TestCrossmap(MutalyzerTest): rna = [2000, 2797, 6405, 6528, 31678, 31750, 47687, 47806, 76448, 76535, 92453, 92554, 123276, 123470, 146090, 146213] cm = Crossmap(rna, [], -1) - assert_equal(cm.x2g(1, -1), 146214) - assert_equal(cm.x2g(1, 0), 146213) - assert_equal(cm.x2g(124, 1), 146089) - assert_equal(cm.x2g(1624, 1), 1999) + assert cm.x2g(1, -1) == 146214 + assert cm.x2g(1, 0) == 146213 + assert cm.x2g(124, 1) == 146089 + assert cm.x2g(1624, 1) == 1999 def test_cds_one_exon(self): """ @@ -253,10 +252,10 @@ class TestCrossmap(MutalyzerTest): rna = [1, 80, 81, 3719] cds = [162, 2123] cm = Crossmap(rna, cds, 1) - assert_equal(cm._Crossmap__crossmapping, [-161, -82, -81, 3558]) - assert_equal(cm.x2g(1, 0), 162) - assert_equal(cm.tuple2string(cm.g2x(2123)), '1962') - assert_equal(cm.tuple2string(cm.g2x(2124)), '*1') + assert cm._Crossmap__crossmapping == [-161, -82, -81, 3558] + assert cm.x2g(1, 0) == 162 + assert cm.tuple2string(cm.g2x(2123)) == '1962' + assert cm.tuple2string(cm.g2x(2124)) == '*1' def test_cds_start_on_splice_site(self): """ @@ -267,15 +266,15 @@ class TestCrossmap(MutalyzerTest): 23894775, 23894899, 23898506, 23899304] cds = [23777833, 23898680] cm = Crossmap(rna, cds, 1) - assert_equal(cm._Crossmap__crossmapping, - [-156, -1, 1, 196, 197, 299, 300, 388, 389, 509, 510, - 583, 584, 708, 709, 1507]) - assert_equal(cm.x2g(1, 0), 23777833) + assert (cm._Crossmap__crossmapping == + [-156, -1, 1, 196, 197, 299, 300, 388, 389, 509, 510, 583, + 584, 708, 709, 1507]) + assert cm.x2g(1, 0) == 23777833 # Fix for r536: disable the -u and +d convention. - #assert_equal(cm.tuple2string(cm.g2x(2123)), '-156-u23752936') - #assert_equal(cm.tuple2string(cm.g2x(2124)), '-156-u23752935') - assert_equal(cm.tuple2string(cm.g2x(2123)), '-23753092') - assert_equal(cm.tuple2string(cm.g2x(2124)), '-23753091') + #assert cm.tuple2string(cm.g2x(2123)) == '-156-u23752936' + #assert cm.tuple2string(cm.g2x(2124)) == '-156-u23752935' + assert cm.tuple2string(cm.g2x(2123)) == '-23753092' + assert cm.tuple2string(cm.g2x(2124)) == '-23753091' def test_cds_start_on_splice_site_reverse(self): """ @@ -287,9 +286,9 @@ class TestCrossmap(MutalyzerTest): 23898506, 23899304] cds = [23755214, 23778028] cm = Crossmap(rna, cds, -1) - assert_equal(cm._Crossmap__crossmapping, - [196, 1, -1, -103, -104, -192, -193, -313, -314, -387, - -388, -512, -513, -1311]) + assert (cm._Crossmap__crossmapping == + [196, 1, -1, -103, -104, -192, -193, -313, -314, -387, -388, + -512, -513, -1311]) def test_cds_start_on_splice_site_other(self): """ @@ -300,9 +299,9 @@ class TestCrossmap(MutalyzerTest): 23894775, 23894899, 23898506, 23899304] cds = [23755214, 23898680] cm = Crossmap(rna, cds, 1) - assert_equal(cm._Crossmap__crossmapping, - [-155, 1, 2, 197, 198, 300, 301, 389, 390, 510, 511, 584, - 585, 709, 710, 1508]) + assert (cm._Crossmap__crossmapping == + [-155, 1, 2, 197, 198, 300, 301, 389, 390, 510, 511, 584, 585, + 709, 710, 1508]) def test_cds_start_on_splice_site_other_reverse(self): """ @@ -314,9 +313,9 @@ class TestCrossmap(MutalyzerTest): 23898506, 23899304] cds = [23755214, 23808749] cm = Crossmap(rna, cds, -1) - assert_equal(cm._Crossmap__crossmapping, - [197, 2, 1, -102, -103, -191, -192, -312, -313, -386, - -387, -511, -512, -1310]) + assert (cm._Crossmap__crossmapping == + [197, 2, 1, -102, -103, -191, -192, -312, -313, -386, -387, + -511, -512, -1310]) def test_cds_start_on_transcript_start(self): """ @@ -328,7 +327,7 @@ class TestCrossmap(MutalyzerTest): 23898506, 23899304] cds = [23777833, 23899304] cm = Crossmap(rna, cds, 1) - assert_equal(cm.x2g(-1, 0), cm.x2g(1, -1)) + assert cm.x2g(-1, 0) == cm.x2g(1, -1) def test_cds_start_on_transcript_start_reverse(self): """ @@ -340,7 +339,7 @@ class TestCrossmap(MutalyzerTest): 23898506, 23899304] cds = [23777833, 23899304] cm = Crossmap(rna, cds, -1) - assert_equal(cm.x2g(-1, 0), cm.x2g(1, -1)) + assert cm.x2g(-1, 0) == cm.x2g(1, -1) def test_cds_is_exon(self): """ @@ -349,8 +348,7 @@ class TestCrossmap(MutalyzerTest): rna = [27745, 27939, 58661, 58762, 74680, 74767] cds = [58661, 58762] cm = Crossmap(rna, cds, 1) - assert_equal(cm._Crossmap__crossmapping, - [-195, -1, 1, 102, 103, 190]) + assert cm._Crossmap__crossmapping == [-195, -1, 1, 102, 103, 190] def test_cds_is_exon_reverse(self): """ @@ -359,5 +357,4 @@ class TestCrossmap(MutalyzerTest): rna = [27745, 27939, 58661, 58762, 74680, 74767] cds = [58661, 58762] cm = Crossmap(rna, cds, -1) - assert_equal(cm._Crossmap__crossmapping, - [297, 103, 102, 1, -1, -88]) + assert cm._Crossmap__crossmapping == [297, 103, 102, 1, -1, -88] diff --git a/tests/test_describe.py b/tests/test_describe.py index 8a7967a2..8315213e 100644 --- a/tests/test_describe.py +++ b/tests/test_describe.py @@ -5,7 +5,6 @@ Tests for the mutalyzer.describe module. #import logging; logging.basicConfig() import os -from nose.tools import * import mutalyzer from mutalyzer import describe @@ -25,7 +24,7 @@ class TestDescribe(MutalyzerTest): 'ATGATGATCAGATACAGTGTGATACAGGTAGTTAGACAA', 'ATGATTTGATCAGATACATGTGATACCGGTAGTTAGGACAA') description = describe.alleleDescription(result) - assert_equal(description, '[5_6insTT;17del;26A>C;35dup]') + assert description == '[5_6insTT;17del;26A>C;35dup]' def test2(self): """ @@ -35,7 +34,7 @@ class TestDescribe(MutalyzerTest): 'TAAGCACCAGGAGTCCATGAAGAAGATGGCTCCTGCCATGGAATCCCCTACTCTACTGTG', 'TAAGCACCAGGAGTCCATGAAGAAGCTGGATCCTCCCATGGAATCCCCTACTCTACTGTG') description = describe.alleleDescription(result) - assert_equal(description, '[26A>C;30C>A;35G>C]') + assert description == '[26A>C;30C>A;35G>C]' def test3(self): """ @@ -45,7 +44,7 @@ class TestDescribe(MutalyzerTest): 'TAAGCACCAGGAGTCCATGAAGAAGATGGCTCCTGCCATGGAATCCCCTACTCTA', 'TAAGCACCAGGAGTCCATGAAGAAGCCATGTCCTGCCATGGAATCCCCTACTCTA') description = describe.alleleDescription(result) - assert_equal(description, '[26_29inv;30C>G]') + assert description == '[26_29inv;30C>G]' def test4(self): """ @@ -55,4 +54,4 @@ class TestDescribe(MutalyzerTest): 'TAAGCACCAGGAGTCCATGAAGAAGATGGCTCCTGCCATGGAATCCCCTACTCTA', 'TAAGCACCAGGAGTCCATGAAGAAGCCATGTCCTGCCATGAATCCCCTACTCTA') description = describe.alleleDescription(result) - assert_equal(description, '[26_29inv;30C>G;41del]') + assert description == '[26_29inv;30C>G;41del]' diff --git a/tests/test_grammar.py b/tests/test_grammar.py index 4c4d6f09..1ebaa399 100644 --- a/tests/test_grammar.py +++ b/tests/test_grammar.py @@ -5,7 +5,6 @@ Tests for the mutalyzer.grammar module. #import logging; logging.basicConfig() import os -from nose.tools import * import mutalyzer from mutalyzer.grammar import Grammar @@ -28,7 +27,7 @@ class TestGrammar(MutalyzerTest): Parse a variant description. """ self.grammar.parse(description) - assert_equal(self.output.getOutput('parseError'), []) + assert self.output.getOutput('parseError') == [] def test_some_variants(self): """ diff --git a/tests/test_mapping.py b/tests/test_mapping.py index 3acb53cb..5ebdc60e 100644 --- a/tests/test_mapping.py +++ b/tests/test_mapping.py @@ -4,7 +4,6 @@ Tests for the mapping module. #import logging; logging.basicConfig() -from nose.tools import * from sqlalchemy import or_ from mutalyzer.db.models import Assembly @@ -41,7 +40,7 @@ class TestConverter(MutalyzerTest): """ converter = self._converter('hg19') genomic = converter.c2chrom('NM_003002.2:c.274G>T') - assert_equal(genomic, 'NC_000011.9:g.111959695G>T') + assert genomic == 'NC_000011.9:g.111959695G>T' coding = converter.chrom2c(genomic, 'list') assert 'NM_003002.2:c.274G>T' in coding # Fix for r536: disable the -u and +d convention. @@ -54,7 +53,7 @@ class TestConverter(MutalyzerTest): """ converter = self._converter('hg19') genomic = converter.c2chrom('NR_028383.1:n.-2173C>A') - assert_equal(genomic, 'NC_000011.9:g.111959695G>T') + assert genomic == 'NC_000011.9:g.111959695G>T' coding = converter.chrom2c(genomic, 'list') assert 'NM_003002.2:c.274G>T' in coding # Fix for r536: disable the -u and +d convention. @@ -67,7 +66,7 @@ class TestConverter(MutalyzerTest): """ converter = self._converter('hg19') genomic = converter.c2chrom('NM_003002.2:c.[274G>T;278A>G]') - assert_equal(genomic, 'NC_000011.9:g.[111959695G>T;111959699A>G]') + assert genomic == 'NC_000011.9:g.[111959695G>T;111959699A>G]' coding = converter.chrom2c(genomic, 'list') assert 'NM_003002.2:c.[274G>T;278A>G]' in coding assert 'NR_028383.1:n.[-2173C>A;-2177T>C]' in coding @@ -88,7 +87,7 @@ class TestConverter(MutalyzerTest): # investigated really). converter = self._converter('hg19') genomic = converter.c2chrom('NM_000500.5:c.92C>T') - assert_equal(genomic, 'NC_000006.11:g.32006291C>T') + assert genomic == 'NC_000006.11:g.32006291C>T' coding = converter.chrom2c(genomic, 'list') assert 'NM_000500.5:c.92C>T' in coding @@ -136,7 +135,7 @@ class TestConverter(MutalyzerTest): """ converter = self._converter('hg19') genomic = converter.c2chrom('NM_003002.2:c.-1_274del') - assert_equal(genomic, 'NC_000011.9:g.111957631_111959695del') + assert genomic == 'NC_000011.9:g.111957631_111959695del' coding = converter.chrom2c(genomic, 'list') assert 'NM_003002.2:c.-1_274del' in coding @@ -146,9 +145,9 @@ class TestConverter(MutalyzerTest): """ converter = self._converter('hg19') genomic = converter.c2chrom('NM_003002.2:c.274_-1del') - assert_equal(genomic, None) + assert genomic == None erange = self.output.getMessagesWithErrorCode('ERANGE') - assert_equal(len(erange), 1) + assert len(erange) == 1 def test_range_order_reverse_correct(self): """ @@ -157,7 +156,7 @@ class TestConverter(MutalyzerTest): """ converter = self._converter('hg19') genomic = converter.c2chrom('NM_001162505.1:c.-1_40del') - assert_equal(genomic, 'NC_000020.10:g.48770135_48770175del') + assert genomic == 'NC_000020.10:g.48770135_48770175del' coding = converter.chrom2c(genomic, 'list') assert 'NM_001162505.1:c.-1_40del' in coding @@ -167,9 +166,9 @@ class TestConverter(MutalyzerTest): """ converter = self._converter('hg19') genomic = converter.c2chrom('NM_001162505.1:c.40_-1del') - assert_equal(genomic, None) + assert genomic == None erange = self.output.getMessagesWithErrorCode('ERANGE') - assert_equal(len(erange), 1) + assert len(erange) == 1 def test_range_order_incorrect_chrom2c(self): """ @@ -177,9 +176,9 @@ class TestConverter(MutalyzerTest): """ converter = self._converter('hg19') coding = converter.chrom2c('NC_000011.9:g.111959695_111957631del', 'list') - assert_equal(coding, None) + assert coding == None erange = self.output.getMessagesWithErrorCode('ERANGE') - assert_equal(len(erange), 1) + assert len(erange) == 1 def test_delins_large_ins_c2chrom(self): """ @@ -187,7 +186,7 @@ class TestConverter(MutalyzerTest): """ converter = self._converter('hg19') genomic = converter.c2chrom('NM_003002.2:c.274delinsTAAA') - assert_equal(genomic, 'NC_000011.9:g.111959695delinsTAAA') + assert genomic == 'NC_000011.9:g.111959695delinsTAAA' coding = converter.chrom2c(genomic, 'list') assert 'NM_003002.2:c.274delinsTAAA' in coding @@ -197,7 +196,7 @@ class TestConverter(MutalyzerTest): """ converter = self._converter('hg19') genomic = converter.c2chrom('NM_003002.2:c.274delGinsTAAA') - assert_equal(genomic, 'NC_000011.9:g.111959695delinsTAAA') + assert genomic == 'NC_000011.9:g.111959695delinsTAAA' coding = converter.chrom2c(genomic, 'list') assert 'NM_003002.2:c.274delinsTAAA' in coding @@ -240,7 +239,7 @@ class TestConverter(MutalyzerTest): """ converter = self._converter('hg19') genomic = converter.c2chrom('NC_012920.1(ND4_v001):c.1271del') - assert_equal(genomic, 'NC_012920.1:m.12030del') + assert genomic == 'NC_012920.1:m.12030del' def test_nm_without_selector_chrom2c(self): """ @@ -248,7 +247,7 @@ class TestConverter(MutalyzerTest): """ converter = self._converter('hg19') genomic = converter.c2chrom('NM_017780.2:c.109A>T') - assert_equal(genomic, 'NC_000008.10:g.61654100A>T') + assert genomic == 'NC_000008.10:g.61654100A>T' def test_nm_with_selector_chrom2c(self): """ @@ -256,7 +255,7 @@ class TestConverter(MutalyzerTest): """ converter = self._converter('hg19') genomic = converter.c2chrom('NM_017780.2(CHD7_v001):c.109A>T') - assert_equal(genomic, 'NC_000008.10:g.61654100A>T') + assert genomic == 'NC_000008.10:g.61654100A>T' def test_nm_c2chrom_no_selector(self): """ @@ -274,7 +273,7 @@ class TestConverter(MutalyzerTest): converter = self._converter('hg19') genomic = converter.c2chrom('NM_017780.2(CHD8):c.109A>T') erange = self.output.getMessagesWithErrorCode('EACCNOTINDB') - assert_equal(len(erange), 1) + assert len(erange) == 1 def test_incorrect_selector_version_c2chrom(self): """ @@ -283,7 +282,7 @@ class TestConverter(MutalyzerTest): converter = self._converter('hg19') genomic = converter.c2chrom('NM_017780.2(CHD7_v002):c.109A>T') erange = self.output.getMessagesWithErrorCode('EACCNOTINDB') - assert_equal(len(erange), 1) + assert len(erange) == 1 def test_no_selector_version_c2chrom(self): """ @@ -291,7 +290,7 @@ class TestConverter(MutalyzerTest): """ converter = self._converter('hg19') genomic = converter.c2chrom('NM_017780.2(CHD7):c.109A>T') - assert_equal(genomic, 'NC_000008.10:g.61654100A>T') + assert genomic == 'NC_000008.10:g.61654100A>T' def test_incorrect_selector_no_selector_version_c2chrom(self): """ @@ -300,7 +299,7 @@ class TestConverter(MutalyzerTest): converter = self._converter('hg19') genomic = converter.c2chrom('NM_017780.2(CHD8):c.109A>T') erange = self.output.getMessagesWithErrorCode('EACCNOTINDB') - assert_equal(len(erange), 1) + assert len(erange) == 1 def test_ins_seq_chrom2c(self): """ @@ -326,7 +325,7 @@ class TestConverter(MutalyzerTest): """ converter = self._converter('hg19') genomic = converter.c2chrom('NM_012459.2:c.10_11insATC') - assert_equal(genomic, 'NC_000011.9:g.111957482_111957483insGAT') + assert genomic == 'NC_000011.9:g.111957482_111957483insGAT' def test_ins_seq_seq_c2chrom_reverse(self): """ @@ -334,4 +333,4 @@ class TestConverter(MutalyzerTest): """ converter = self._converter('hg19') genomic = converter.c2chrom('NM_012459.2:c.10_11ins[TTT;ATC]') - assert_equal(genomic, 'NC_000011.9:g.111957482_111957483ins[GAT;AAA]') + assert genomic == 'NC_000011.9:g.111957482_111957483ins[GAT;AAA]' diff --git a/tests/test_mutator.py b/tests/test_mutator.py index 43117c69..36c5b8d1 100644 --- a/tests/test_mutator.py +++ b/tests/test_mutator.py @@ -7,7 +7,6 @@ Tests for the mutalyzer.mutator module. import re import os import random -from nose.tools import * from Bio.Seq import Seq import mutalyzer @@ -49,7 +48,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(_seq(l)) # Numbering is 1-based for i in range(1, l + 1): - assert_equal(m.shift(i), i) + assert m.shift(i) == i def test_shift_del_example(self): """ @@ -57,9 +56,9 @@ class TestMutator(MutalyzerTest): """ m = self._mutator(Seq('ATCGATCG')) m.deletion(2, 2) - assert_equal(m.shift(1), 1) - assert_equal(m.shift(2), 2) - assert_equal(m.shift(3), 2) + assert m.shift(1) == 1 + assert m.shift(2) == 2 + assert m.shift(3) == 2 def test_shift_del(self): """ @@ -70,9 +69,9 @@ class TestMutator(MutalyzerTest): m = self._mutator(_seq(l)) m.deletion(d, d) for p in range(1, d + 1): - assert_equal(m.shift(p), p) + assert m.shift(p) == p for p in range(d + 1, l + 1): - assert_equal(m.shift(p), p - 1) + assert m.shift(p) == p - 1 def test_shift_del2(self): """ @@ -83,9 +82,9 @@ class TestMutator(MutalyzerTest): m = self._mutator(_seq(l)) m.deletion(d, d + 1) for p in range(1, d + 2): - assert_equal(m.shift(p), p) + assert m.shift(p) == p for p in range(d + 2, l + 1): - assert_equal(m.shift(p), p - 2) + assert m.shift(p) == p - 2 def test_shift_ins_example(self): """ @@ -93,9 +92,9 @@ class TestMutator(MutalyzerTest): """ m = self._mutator(Seq('ATCGATCG')) m.insertion(2, 'A') - assert_equal(m.shift(1), 1) - assert_equal(m.shift(2), 2) - assert_equal(m.shift(3), 4) + assert m.shift(1) == 1 + assert m.shift(2) == 2 + assert m.shift(3) == 4 def test_shift_ins(self): """ @@ -106,9 +105,9 @@ class TestMutator(MutalyzerTest): m = self._mutator(_seq(l)) m.insertion(i, 'T') for p in range(1, i + 1): - assert_equal(m.shift(p), p) + assert m.shift(p) == p for p in range(i + 1, l + 1): - assert_equal(m.shift(p), p + 1) + assert m.shift(p) == p + 1 def test_shift_ins2(self): """ @@ -119,9 +118,9 @@ class TestMutator(MutalyzerTest): m = self._mutator(_seq(l)) m.insertion(i, 'TT') for p in range(1, i + 1): - assert_equal(m.shift(p), p) + assert m.shift(p) == p for p in range(i + 1, l + 1): - assert_equal(m.shift(p), p + 2) + assert m.shift(p) == p + 2 def test_shift_sites_no_change(self): """ @@ -137,7 +136,7 @@ class TestMutator(MutalyzerTest): l = 30 sites = [4, 9, 14, 19, 25, 27] m = self._mutator(_seq(l)) - assert_equal(m.shift_sites(sites), sites) + assert m.shift_sites(sites) == sites def test_shift_sites_acc_del_before(self): """ @@ -149,7 +148,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 14, 17, 25, 27] m = self._mutator(_seq(l)) m.deletion(13, 13) # g.13del - assert_equal(m.shift_sites(sites), [4, 9, 13, 16, 24, 26]) + assert m.shift_sites(sites) == [4, 9, 13, 16, 24, 26] def test_shift_sites_acc_del_after(self): """ @@ -159,7 +158,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 14, 17, 25, 27] m = self._mutator(_seq(l)) m.deletion(14, 14) # g.14del - assert_equal(m.shift_sites(sites), [4, 9, 14, 16, 24, 26]) + assert m.shift_sites(sites) == [4, 9, 14, 16, 24, 26] def test_shift_sites_don_del_before(self): """ @@ -169,7 +168,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 14, 17, 25, 27] m = self._mutator(_seq(l)) m.deletion(17, 17) # g.17del - assert_equal(m.shift_sites(sites), [4, 9, 14, 16, 24, 26]) + assert m.shift_sites(sites) == [4, 9, 14, 16, 24, 26] def test_shift_sites_don_del_after(self): """ @@ -181,7 +180,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 14, 17, 25, 27] m = self._mutator(_seq(l)) m.deletion(18, 18) # g.18del - assert_equal(m.shift_sites(sites), [4, 9, 14, 17, 24, 26]) + assert m.shift_sites(sites) == [4, 9, 14, 17, 24, 26] def test_shift_sites_acc_del2_before(self): """ @@ -193,7 +192,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 14, 17, 25, 27] m = self._mutator(_seq(l)) m.deletion(12, 13) # g.12_13del - assert_equal(m.shift_sites(sites), [4, 9, 12, 15, 23, 25]) + assert m.shift_sites(sites) == [4, 9, 12, 15, 23, 25] def test_shift_sites_acc_del2_on(self): """ @@ -207,7 +206,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 14, 17, 25, 27] m = self._mutator(_seq(l)) m.deletion(13, 14) # g.13_14del - assert_equal(m.shift_sites(sites), [4, 9, 13, 15, 23, 25]) + assert m.shift_sites(sites) == [4, 9, 13, 15, 23, 25] def test_shift_sites_acc_del2_after(self): """ @@ -217,7 +216,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 14, 17, 25, 27] m = self._mutator(_seq(l)) m.deletion(14, 15) # g.14_15del - assert_equal(m.shift_sites(sites), [4, 9, 14, 15, 23, 25]) + assert m.shift_sites(sites) == [4, 9, 14, 15, 23, 25] def test_shift_sites_don_del2_before(self): """ @@ -227,7 +226,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 14, 17, 25, 27] m = self._mutator(_seq(l)) m.deletion(16, 17) # g.16_17del - assert_equal(m.shift_sites(sites), [4, 9, 14, 15, 23, 25]) + assert m.shift_sites(sites) == [4, 9, 14, 15, 23, 25] def test_shift_sites_don_del2_on(self): """ @@ -241,7 +240,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 14, 17, 25, 27] m = self._mutator(_seq(l)) m.deletion(17, 18) # g.17_18del - assert_equal(m.shift_sites(sites), [4, 9, 14, 16, 23, 25]) + assert m.shift_sites(sites) == [4, 9, 14, 16, 23, 25] def test_shift_sites_don_del2_after(self): """ @@ -253,7 +252,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 14, 17, 25, 27] m = self._mutator(_seq(l)) m.deletion(18, 19) # g.18_19del - assert_equal(m.shift_sites(sites), [4, 9, 14, 17, 23, 25]) + assert m.shift_sites(sites) == [4, 9, 14, 17, 23, 25] def test_shift_sites_acc_ins_before(self): """ @@ -265,7 +264,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 14, 17, 25, 27] m = self._mutator(_seq(l)) m.insertion(12, 'A') # g.12_13insA - assert_equal(m.shift_sites(sites), [4, 9, 15, 18, 26, 28]) + assert m.shift_sites(sites) == [4, 9, 15, 18, 26, 28] def test_shift_sites_acc_ins_on(self): """ @@ -275,7 +274,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 14, 17, 25, 27] m = self._mutator(_seq(l)) m.insertion(13, 'A') # g.13_14insA - assert_equal(m.shift_sites(sites), [4, 9, 14, 18, 26, 28]) + assert m.shift_sites(sites) == [4, 9, 14, 18, 26, 28] def test_shift_sites_first_acc_ins_on(self): """ @@ -285,7 +284,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 14, 17, 25, 27] m = self._mutator(_seq(l)) m.insertion(3, 'A') # g.3_4insA - assert_equal(m.shift_sites(sites), [5, 10, 15, 18, 26, 28]) + assert m.shift_sites(sites) == [5, 10, 15, 18, 26, 28] def test_shift_sites_acc_ins_after(self): """ @@ -295,7 +294,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 14, 17, 25, 27] m = self._mutator(_seq(l)) m.insertion(14, 'A') # g.14_15insA - assert_equal(m.shift_sites(sites), [4, 9, 14, 18, 26, 28]) + assert m.shift_sites(sites) == [4, 9, 14, 18, 26, 28] def test_shift_sites_don_ins_before(self): """ @@ -305,7 +304,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 14, 17, 25, 27] m = self._mutator(_seq(l)) m.insertion(16, 'A') # g.16_17insA - assert_equal(m.shift_sites(sites), [4, 9, 14, 18, 26, 28]) + assert m.shift_sites(sites) == [4, 9, 14, 18, 26, 28] def test_shift_sites_don_ins_on(self): """ @@ -315,7 +314,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 14, 17, 25, 27] m = self._mutator(_seq(l)) m.insertion(17, 'A') # g.17_18insA - assert_equal(m.shift_sites(sites), [4, 9, 14, 18, 26, 28]) + assert m.shift_sites(sites) == [4, 9, 14, 18, 26, 28] def test_shift_sites_last_don_ins_on(self): """ @@ -325,7 +324,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 14, 17, 25, 27] m = self._mutator(_seq(l)) m.insertion(27, 'A') # g.27_28insA - assert_equal(m.shift_sites(sites), [4, 9, 14, 17, 25, 27]) + assert m.shift_sites(sites) == [4, 9, 14, 17, 25, 27] def test_shift_sites_don_ins_after(self): """ @@ -337,7 +336,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 14, 17, 25, 27] m = self._mutator(_seq(l)) m.insertion(18, 'A') # g.18_19insA - assert_equal(m.shift_sites(sites), [4, 9, 14, 17, 26, 28]) + assert m.shift_sites(sites) == [4, 9, 14, 17, 26, 28] def test_shift_sites_acc_ins2_before(self): """ @@ -349,7 +348,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 14, 17, 25, 27] m = self._mutator(_seq(l)) m.insertion(12, 'AT') # g.12_13insAT - assert_equal(m.shift_sites(sites), [4, 9, 16, 19, 27, 29]) + assert m.shift_sites(sites) == [4, 9, 16, 19, 27, 29] def test_shift_sites_first_acc_ins2_on(self): """ @@ -359,7 +358,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 14, 17, 25, 27] m = self._mutator(_seq(l)) m.insertion(3, 'AT') # g.3_4insAT - assert_equal(m.shift_sites(sites), [6, 11, 16, 19, 27, 29]) + assert m.shift_sites(sites) == [6, 11, 16, 19, 27, 29] def test_shift_sites_acc_ins2_after(self): """ @@ -369,7 +368,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 14, 17, 25, 27] m = self._mutator(_seq(l)) m.insertion(14, 'AT') # g.14_15insAT - assert_equal(m.shift_sites(sites), [4, 9, 14, 19, 27, 29]) + assert m.shift_sites(sites) == [4, 9, 14, 19, 27, 29] def test_shift_sites_don_ins2_before(self): """ @@ -379,7 +378,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 14, 17, 25, 27] m = self._mutator(_seq(l)) m.insertion(16, 'AT') # g.16_17insAT - assert_equal(m.shift_sites(sites), [4, 9, 14, 19, 27, 29]) + assert m.shift_sites(sites) == [4, 9, 14, 19, 27, 29] def test_shift_sites_last_don_ins2_on(self): """ @@ -389,7 +388,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 14, 17, 25, 27] m = self._mutator(_seq(l)) m.insertion(27, 'AT') # g.27_28insAT - assert_equal(m.shift_sites(sites), [4, 9, 14, 17, 25, 27]) + assert m.shift_sites(sites) == [4, 9, 14, 17, 25, 27] def test_shift_sites_don_ins2_after(self): """ @@ -401,7 +400,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 14, 17, 25, 27] m = self._mutator(_seq(l)) m.insertion(18, 'AT') # g.18_19insAT - assert_equal(m.shift_sites(sites), [4, 9, 14, 17, 27, 29]) + assert m.shift_sites(sites) == [4, 9, 14, 17, 27, 29] def test_shift_sites_acc_ins3_before(self): """ @@ -413,7 +412,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 14, 17, 25, 27] m = self._mutator(_seq(l)) m.insertion(12, 'ATT') # g.12_13insATT - assert_equal(m.shift_sites(sites), [4, 9, 17, 20, 28, 30]) + assert m.shift_sites(sites) == [4, 9, 17, 20, 28, 30] def test_shift_sites_acc_ins3_on(self): """ @@ -423,7 +422,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 14, 17, 25, 27] m = self._mutator(_seq(l)) m.insertion(13, 'ATT') # g.13_14insATT - assert_equal(m.shift_sites(sites), [4, 9, 14, 20, 28, 30]) + assert m.shift_sites(sites) == [4, 9, 14, 20, 28, 30] def test_shift_sites_first_acc_ins3_on(self): """ @@ -433,7 +432,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 14, 17, 25, 27] m = self._mutator(_seq(l)) m.insertion(3, 'ATT') # g.3_4insATT - assert_equal(m.shift_sites(sites), [7, 12, 17, 20, 28, 30]) + assert m.shift_sites(sites) == [7, 12, 17, 20, 28, 30] def test_shift_sites_acc_ins3_after(self): """ @@ -443,7 +442,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 14, 17, 25, 27] m = self._mutator(_seq(l)) m.insertion(14, 'ATT') # g.14_15insATT - assert_equal(m.shift_sites(sites), [4, 9, 14, 20, 28, 30]) + assert m.shift_sites(sites) == [4, 9, 14, 20, 28, 30] def test_shift_sites_don_ins3_before(self): """ @@ -453,7 +452,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 14, 17, 25, 27] m = self._mutator(_seq(l)) m.insertion(16, 'ATT') # g.16_17insATT - assert_equal(m.shift_sites(sites), [4, 9, 14, 20, 28, 30]) + assert m.shift_sites(sites) == [4, 9, 14, 20, 28, 30] def test_shift_sites_don_ins3_on(self): """ @@ -463,7 +462,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 14, 17, 25, 27] m = self._mutator(_seq(l)) m.insertion(17, 'ATT') # g.17_18insATT - assert_equal(m.shift_sites(sites), [4, 9, 14, 20, 28, 30]) + assert m.shift_sites(sites) == [4, 9, 14, 20, 28, 30] def test_shift_sites_last_don_ins3_on(self): """ @@ -473,7 +472,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 14, 17, 25, 27] m = self._mutator(_seq(l)) m.insertion(27, 'ATT') # g.27_28insATT - assert_equal(m.shift_sites(sites), [4, 9, 14, 17, 25, 27]) + assert m.shift_sites(sites) == [4, 9, 14, 17, 25, 27] def test_shift_sites_don_ins3_after(self): """ @@ -485,7 +484,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 14, 17, 25, 27] m = self._mutator(_seq(l)) m.insertion(18, 'ATT') # g.18_19insATT - assert_equal(m.shift_sites(sites), [4, 9, 14, 17, 28, 30]) + assert m.shift_sites(sites) == [4, 9, 14, 17, 28, 30] def test_shift_sites_adj_del_before1(self): """ @@ -502,7 +501,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 10, 17, 18, 27] m = self._mutator(_seq(l)) m.deletion(16, 16) # g.16del - assert_equal(m.shift_sites(sites), [4, 9, 10, 16, 17, 26]) + assert m.shift_sites(sites) == [4, 9, 10, 16, 17, 26] def test_shift_sites_adj_del_before(self): """ @@ -512,7 +511,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 10, 17, 18, 27] m = self._mutator(_seq(l)) m.deletion(17, 17) # g.17del - assert_equal(m.shift_sites(sites), [4, 9, 10, 16, 17, 26]) + assert m.shift_sites(sites) == [4, 9, 10, 16, 17, 26] def test_shift_sites_adj_del_after(self): """ @@ -522,7 +521,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 10, 17, 18, 27] m = self._mutator(_seq(l)) m.deletion(18, 18) # g.18del - assert_equal(m.shift_sites(sites), [4, 9, 10, 17, 18, 26]) + assert m.shift_sites(sites) == [4, 9, 10, 17, 18, 26] def test_shift_sites_adj_del_after1(self): """ @@ -532,7 +531,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 10, 17, 18, 27] m = self._mutator(_seq(l)) m.deletion(19, 19) # g.19del - assert_equal(m.shift_sites(sites), [4, 9, 10, 17, 18, 26]) + assert m.shift_sites(sites) == [4, 9, 10, 17, 18, 26] def test_shift_sites_adj_ins_before(self): """ @@ -542,7 +541,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 10, 17, 18, 27] m = self._mutator(_seq(l)) m.insertion(16, 'A') # g.16_17insA - assert_equal(m.shift_sites(sites), [4, 9, 10, 18, 19, 28]) + assert m.shift_sites(sites) == [4, 9, 10, 18, 19, 28] def test_shift_sites_adj_ins_on(self): """ @@ -558,7 +557,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 10, 17, 18, 27] m = self._mutator(_seq(l)) m.insertion(17, 'A') # g.17_18insA - assert_equal(m.shift_sites(sites), [4, 9, 10, 18, 19, 28]) + assert m.shift_sites(sites) == [4, 9, 10, 18, 19, 28] def test_shift_sites_adj_ins_after(self): """ @@ -568,7 +567,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 10, 17, 18, 27] m = self._mutator(_seq(l)) m.insertion(18, 'A') # g.18_19insA - assert_equal(m.shift_sites(sites), [4, 9, 10, 17, 18, 28]) + assert m.shift_sites(sites) == [4, 9, 10, 17, 18, 28] def test_shift_sites_adj_del2_before1(self): """ @@ -578,7 +577,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 10, 17, 18, 27] m = self._mutator(_seq(l)) m.deletion(15, 16) # g.15_16del - assert_equal(m.shift_sites(sites), [4, 9, 10, 15, 16, 25]) + assert m.shift_sites(sites) == [4, 9, 10, 15, 16, 25] def test_shift_sites_adj_del2_before(self): """ @@ -588,7 +587,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 10, 17, 18, 27] m = self._mutator(_seq(l)) m.deletion(16, 17) # g.16_17del - assert_equal(m.shift_sites(sites), [4, 9, 10, 15, 16, 25]) + assert m.shift_sites(sites) == [4, 9, 10, 15, 16, 25] def test_shift_sites_adj_del2_on(self): """ @@ -603,7 +602,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 10, 17, 18, 27] m = self._mutator(_seq(l)) m.deletion(17, 18) # g.17_18del - assert_equal(m.shift_sites(sites), [4, 9, 10, 16, 17, 25]) + assert m.shift_sites(sites) == [4, 9, 10, 16, 17, 25] def test_shift_sites_adj_del2_after(self): """ @@ -613,7 +612,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 10, 17, 18, 27] m = self._mutator(_seq(l)) m.deletion(18, 19) # g.18_19del - assert_equal(m.shift_sites(sites), [4, 9, 10, 17, 18, 25]) + assert m.shift_sites(sites) == [4, 9, 10, 17, 18, 25] def test_shift_sites_adj_del2_after1(self): """ @@ -623,7 +622,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 10, 17, 18, 27] m = self._mutator(_seq(l)) m.deletion(19, 20) # g.19_20del - assert_equal(m.shift_sites(sites), [4, 9, 10, 17, 18, 25]) + assert m.shift_sites(sites) == [4, 9, 10, 17, 18, 25] def test_shift_sites_adj_ins2_before(self): """ @@ -633,7 +632,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 10, 17, 18, 27] m = self._mutator(_seq(l)) m.insertion(16, 'AT') # g.16_17insAT - assert_equal(m.shift_sites(sites), [4, 9, 10, 19, 20, 29]) + assert m.shift_sites(sites) == [4, 9, 10, 19, 20, 29] def test_shift_sites_adj_ins2_on(self): """ @@ -649,7 +648,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 10, 17, 18, 27] m = self._mutator(_seq(l)) m.insertion(17, 'AT') # g.17_18insAT - assert_equal(m.shift_sites(sites), [4, 9, 10, 19, 20, 29]) + assert m.shift_sites(sites) == [4, 9, 10, 19, 20, 29] def test_shift_sites_adj_ins2_after(self): """ @@ -659,7 +658,7 @@ class TestMutator(MutalyzerTest): sites = [4, 9, 10, 17, 18, 27] m = self._mutator(_seq(l)) m.insertion(18, 'AT') # g.18_19insAT - assert_equal(m.shift_sites(sites), [4, 9, 10, 17, 18, 29]) + assert m.shift_sites(sites) == [4, 9, 10, 17, 18, 29] def test_del(self): """ @@ -667,7 +666,7 @@ class TestMutator(MutalyzerTest): """ m = self._mutator(Seq('ATCGATCG')) m.deletion(2, 2) - assert_equal(str(m.mutated), str(Seq('ACGATCG'))) + assert str(m.mutated) == str(Seq('ACGATCG')) def test_largedel(self): """ @@ -675,7 +674,7 @@ class TestMutator(MutalyzerTest): """ m = self._mutator(Seq('ATCGATCG')) m.deletion(2, 7) - assert_equal(str(m.mutated), str(Seq('AG'))) + assert str(m.mutated) == str(Seq('AG')) def test_ins(self): """ @@ -683,7 +682,7 @@ class TestMutator(MutalyzerTest): """ m = self._mutator(Seq('ATCGATCG')) m.insertion(2, 'A') - assert_equal(str(m.mutated), str(Seq('ATACGATCG'))) + assert str(m.mutated) == str(Seq('ATACGATCG')) def test_largeins(self): """ @@ -691,7 +690,7 @@ class TestMutator(MutalyzerTest): """ m = self._mutator(Seq('ATCGATCG')) m.insertion(2, 'ATCG') - assert_equal(str(m.mutated), str(Seq('ATATCGCGATCG'))) + assert str(m.mutated) == str(Seq('ATATCGCGATCG')) def test_sub(self): """ @@ -699,7 +698,7 @@ class TestMutator(MutalyzerTest): """ m = self._mutator(Seq('ATCGATCG')) m.substitution(3, 'G') - assert_equal(str(m.mutated), str(Seq('ATGGATCG'))) + assert str(m.mutated) == str(Seq('ATGGATCG')) def test_adjecent_del_sub_1(self): """ @@ -710,7 +709,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.deletion(2, 2) m.substitution(3, 'G') - assert_equal(str(m.mutated), str(Seq('AGGATCG'))) + assert str(m.mutated) == str(Seq('AGGATCG')) def test_adjecent_del_sub_2(self): """ @@ -719,7 +718,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.deletion(3, 3) m.substitution(2, 'G') - assert_equal(str(m.mutated), str(Seq('AGGATCG'))) + assert str(m.mutated) == str(Seq('AGGATCG')) def test_near_adjecent_del_sub_1(self): """ @@ -728,7 +727,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.deletion(2, 2) m.substitution(4, 'T') - assert_equal(str(m.mutated), str(Seq('ACTATCG'))) + assert str(m.mutated) == str(Seq('ACTATCG')) def test_near_adjecent_del_sub_2(self): """ @@ -737,7 +736,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.deletion(4, 4) m.substitution(2, 'G') - assert_equal(str(m.mutated), str(Seq('AGCATCG'))) + assert str(m.mutated) == str(Seq('AGCATCG')) def test_adjecent_largedel_sub_1(self): """ @@ -747,7 +746,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.deletion(2, 6) m.substitution(7, 'T') - assert_equal(str(m.mutated), str(Seq('ATG'))) + assert str(m.mutated) == str(Seq('ATG')) def test_adjecent_largedel_sub_2(self): """ @@ -757,7 +756,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.deletion(3, 7) m.substitution(2, 'C') - assert_equal(str(m.mutated), str(Seq('ACG'))) + assert str(m.mutated) == str(Seq('ACG')) def test_near_adjecent_largedel_sub_1(self): """ @@ -766,7 +765,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.deletion(2, 5) m.substitution(7, 'T') - assert_equal(str(m.mutated), str(Seq('ATTG'))) + assert str(m.mutated) == str(Seq('ATTG')) def test_near_adjecent_largedel_sub_2(self): """ @@ -775,7 +774,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.deletion(4, 7) m.substitution(2, 'C') - assert_equal(str(m.mutated), str(Seq('ACCG'))) + assert str(m.mutated) == str(Seq('ACCG')) def test_adjectent_del_ins_1(self): """ @@ -784,7 +783,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.deletion(2, 2) m.insertion(2, 'G') - assert_equal(str(m.mutated), str(Seq('AGCGATCG'))) + assert str(m.mutated) == str(Seq('AGCGATCG')) def test_adjectent_del_ins_2(self): """ @@ -793,7 +792,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.deletion(3, 3) m.insertion(2, 'A') - assert_equal(str(m.mutated), str(Seq('ATAGATCG'))) + assert str(m.mutated) == str(Seq('ATAGATCG')) def test_near_adjectent_del_ins(self): """ @@ -802,7 +801,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.deletion(2, 2) m.insertion(3, 'T') - assert_equal(str(m.mutated), str(Seq('ACTGATCG'))) + assert str(m.mutated) == str(Seq('ACTGATCG')) def test_adjecent_ins_sub_1(self): """ @@ -812,7 +811,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.insertion(2, 'A') m.substitution(3, 'G') - assert_equal(str(m.mutated), str(Seq('ATAGGATCG'))) + assert str(m.mutated) == str(Seq('ATAGGATCG')) def test_adjecent_ins_sub_2(self): """ @@ -822,7 +821,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.insertion(2, 'A') m.substitution(2, 'G') - assert_equal(str(m.mutated), str(Seq('AGACGATCG'))) + assert str(m.mutated) == str(Seq('AGACGATCG')) def test_near_adjecent_ins_sub(self): """ @@ -832,7 +831,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.insertion(2, 'A') m.substitution(4, 'T') - assert_equal(str(m.mutated), str(Seq('ATACTATCG'))) + assert str(m.mutated) == str(Seq('ATACTATCG')) def test_adjecent_largeins_sub_1(self): """ @@ -842,7 +841,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.insertion(2, 'ATCG') m.substitution(3, 'G') - assert_equal(str(m.mutated), str(Seq('ATATCGGGATCG'))) + assert str(m.mutated) == str(Seq('ATATCGGGATCG')) def test_adjecent_largeins_sub_2(self): """ @@ -852,7 +851,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.insertion(2, 'ATCG') m.substitution(2, 'G') - assert_equal(str(m.mutated), str(Seq('AGATCGCGATCG'))) + assert str(m.mutated) == str(Seq('AGATCGCGATCG')) def test_near_adjecent_largeins_sub(self): """ @@ -862,7 +861,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.insertion(2, 'ATCG') m.substitution(4, 'T') - assert_equal(str(m.mutated), str(Seq('ATATCGCTATCG'))) + assert str(m.mutated) == str(Seq('ATATCGCTATCG')) def test_adjecent_del_del_1(self): """ @@ -871,7 +870,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.deletion(2, 2) m.deletion(3, 3) - assert_equal(str(m.mutated), str(Seq('AGATCG'))) + assert str(m.mutated) == str(Seq('AGATCG')) def test_adjecent_del_del_2(self): """ @@ -880,7 +879,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.deletion(3, 3) m.deletion(2, 2) - assert_equal(str(m.mutated), str(Seq('AGATCG'))) + assert str(m.mutated) == str(Seq('AGATCG')) def test_adjecent_delins_snp_1(self): """ @@ -889,7 +888,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.delins(2, 2, 'A') m.substitution(3, 'G') - assert_equal(str(m.mutated), str(Seq('AAGGATCG'))) + assert str(m.mutated) == str(Seq('AAGGATCG')) def test_adjecent_delins_snp_2(self): """ @@ -898,7 +897,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.delins(3, 3, 'A') m.substitution(2, 'G') - assert_equal(str(m.mutated), str(Seq('AGAGATCG'))) + assert str(m.mutated) == str(Seq('AGAGATCG')) def test_adjecent_largedelins_eq_snp_1(self): """ @@ -908,7 +907,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.delins(2, 6, 'AAAAA') m.substitution(7, 'G') - assert_equal(str(m.mutated), str(Seq('AAAAAAGG'))) + assert str(m.mutated) == str(Seq('AAAAAAGG')) def test_adjecent_largedelins_min_snp_1(self): """ @@ -918,7 +917,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.delins(2, 6, 'AAA') m.substitution(7, 'G') - assert_equal(str(m.mutated), str(Seq('AAAAGG'))) + assert str(m.mutated) == str(Seq('AAAAGG')) def test_adjecent_largedelins_plus_snp_1(self): """ @@ -928,7 +927,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.delins(2, 6, 'AAAAAAA') m.substitution(7, 'G') - assert_equal(str(m.mutated), str(Seq('AAAAAAAAGG'))) + assert str(m.mutated) == str(Seq('AAAAAAAAGG')) def test_adjecent_largedelins_eq_snp_2(self): """ @@ -938,7 +937,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.delins(3, 7, 'AAAAA') m.substitution(2, 'G') - assert_equal(str(m.mutated), str(Seq('AGAAAAAG'))) + assert str(m.mutated) == str(Seq('AGAAAAAG')) def test_adjecent_largedelins_min_snp_2(self): """ @@ -948,7 +947,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.delins(3, 7, 'AAA') m.substitution(2, 'G') - assert_equal(str(m.mutated), str(Seq('AGAAAG'))) + assert str(m.mutated) == str(Seq('AGAAAG')) def test_adjecent_largedelins_plus_snp_2(self): """ @@ -958,7 +957,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.delins(3, 7, 'AAAAAAA') m.substitution(2, 'G') - assert_equal(str(m.mutated), str(Seq('AGAAAAAAAG'))) + assert str(m.mutated) == str(Seq('AGAAAAAAAG')) def test_adjecent_delins_del_1(self): """ @@ -967,7 +966,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.delins(2, 2, 'A') m.deletion(3, 3) - assert_equal(str(m.mutated), str(Seq('AAGATCG'))) + assert str(m.mutated) == str(Seq('AAGATCG')) def test_adjecent_delins_del_2(self): """ @@ -976,7 +975,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.delins(3, 3, 'A') m.deletion(2, 2) - assert_equal(str(m.mutated), str(Seq('AAGATCG'))) + assert str(m.mutated) == str(Seq('AAGATCG')) def test_adjecent_largedelins_eq_del_1(self): """ @@ -986,7 +985,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.delins(2, 6, 'AAAAA') m.deletion(7, 7) - assert_equal(str(m.mutated), str(Seq('AAAAAAG'))) + assert str(m.mutated) == str(Seq('AAAAAAG')) def test_adjecent_largedelins_min_del_1(self): """ @@ -996,7 +995,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.delins(2, 6, 'AAA') m.deletion(7, 7) - assert_equal(str(m.mutated), str(Seq('AAAAG'))) + assert str(m.mutated) == str(Seq('AAAAG')) def test_adjecent_largedelins_plus_del_1(self): """ @@ -1006,7 +1005,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.delins(2, 6, 'AAAAAAA') m.deletion(7, 7) - assert_equal(str(m.mutated), str(Seq('AAAAAAAAG'))) + assert str(m.mutated) == str(Seq('AAAAAAAAG')) def test_adjecent_largedelins_eq_del_2(self): """ @@ -1016,7 +1015,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.delins(3, 7, 'AAAAA') m.deletion(2, 2) - assert_equal(str(m.mutated), str(Seq('AAAAAAG'))) + assert str(m.mutated) == str(Seq('AAAAAAG')) def test_adjecent_largedelins_min_del_2(self): """ @@ -1026,7 +1025,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.delins(3, 7, 'AAA') m.deletion(2, 2) - assert_equal(str(m.mutated), str(Seq('AAAAG'))) + assert str(m.mutated) == str(Seq('AAAAG')) def test_adjecent_largedelins_plus_del_2(self): """ @@ -1036,7 +1035,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.delins(3, 7, 'AAAAAAA') m.deletion(2, 2) - assert_equal(str(m.mutated), str(Seq('AAAAAAAAG'))) + assert str(m.mutated) == str(Seq('AAAAAAAAG')) def test_adjectent_delins_ins_1(self): """ @@ -1045,7 +1044,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.delins(2, 2, 'A') m.insertion(2, 'G') - assert_equal(str(m.mutated), str(Seq('AAGCGATCG'))) + assert str(m.mutated) == str(Seq('AAGCGATCG')) def test_adjectent_delins_ins_2(self): """ @@ -1054,7 +1053,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.delins(3, 3, 'A') m.insertion(2, 'G') - assert_equal(str(m.mutated), str(Seq('ATGAGATCG'))) + assert str(m.mutated) == str(Seq('ATGAGATCG')) def test_adjectent_largedelins_eq_ins_1(self): """ @@ -1063,7 +1062,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.delins(2, 6, 'AAAAA') m.insertion(6, 'G') - assert_equal(str(m.mutated), str(Seq('AAAAAAGCG'))) + assert str(m.mutated) == str(Seq('AAAAAAGCG')) def test_adjectent_largedelins_min_ins_1(self): """ @@ -1072,7 +1071,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.delins(2, 6, 'AAA') m.insertion(6, 'G') - assert_equal(str(m.mutated), str(Seq('AAAAGCG'))) + assert str(m.mutated) == str(Seq('AAAAGCG')) def test_adjectent_largedelins_plus_ins_1(self): """ @@ -1081,7 +1080,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.delins(2, 6, 'AAAAAAA') m.insertion(6, 'G') - assert_equal(str(m.mutated), str(Seq('AAAAAAAAGCG'))) + assert str(m.mutated) == str(Seq('AAAAAAAAGCG')) def test_adjectent_largedelins_eq_ins_2(self): """ @@ -1090,7 +1089,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.delins(3, 7, 'AAAAA') m.insertion(2, 'G') - assert_equal(str(m.mutated), str(Seq('ATGAAAAAG'))) + assert str(m.mutated) == str(Seq('ATGAAAAAG')) def test_adjectent_largedelins_min_ins_2(self): """ @@ -1099,7 +1098,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.delins(3, 7, 'AAA') m.insertion(2, 'G') - assert_equal(str(m.mutated), str(Seq('ATGAAAG'))) + assert str(m.mutated) == str(Seq('ATGAAAG')) def test_adjectent_largedelins_plus_ins_2(self): """ @@ -1108,7 +1107,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.delins(3, 7, 'AAAAAAA') m.insertion(2, 'G') - assert_equal(str(m.mutated), str(Seq('ATGAAAAAAAG'))) + assert str(m.mutated) == str(Seq('ATGAAAAAAAG')) def test_adjectent_delins_del_delins(self): """ @@ -1117,7 +1116,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.delins(2, 3, 'A') m.delins(4, 4, 'T') - assert_equal(str(m.mutated), str(Seq('AATATCG'))) + assert str(m.mutated) == str(Seq('AATATCG')) def test_adjectent_largedelins_plus_delins_1(self): """ @@ -1126,7 +1125,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.delins(2, 6, 'AAAAAAA') m.delins(7, 7, 'T') - assert_equal(str(m.mutated), str(Seq('AAAAAAAATG'))) + assert str(m.mutated) == str(Seq('AAAAAAAATG')) def test_adjectent_largedelins_plus_delins_2(self): """ @@ -1135,7 +1134,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.delins(3, 7, 'AAAAAAA') m.delins(2, 2, 'C') - assert_equal(str(m.mutated), str(Seq('ACAAAAAAAG'))) + assert str(m.mutated) == str(Seq('ACAAAAAAAG')) def test_adjectent_largedelins_min_delins_1(self): """ @@ -1144,7 +1143,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.delins(2, 6, 'AAA') m.delins(7, 7, 'T') - assert_equal(str(m.mutated), str(Seq('AAAATG'))) + assert str(m.mutated) == str(Seq('AAAATG')) def test_adjectent_largedelins_min_delins_2(self): """ @@ -1153,7 +1152,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.delins(3, 7, 'AAA') m.delins(2, 2, 'C') - assert_equal(str(m.mutated), str(Seq('ACAAAG'))) + assert str(m.mutated) == str(Seq('ACAAAG')) def test_adjectent_del_dup_1(self): """ @@ -1162,7 +1161,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.deletion(2, 2) m.duplication(3, 3) - assert_equal(str(m.mutated), str(Seq('ACCGATCG'))) + assert str(m.mutated) == str(Seq('ACCGATCG')) def test_adjectent_del_dup_2(self): """ @@ -1171,7 +1170,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.deletion(3, 3) m.duplication(2, 2) - assert_equal(str(m.mutated), str(Seq('ATTGATCG'))) + assert str(m.mutated) == str(Seq('ATTGATCG')) def test_adjectent_ins_dup_1(self): """ @@ -1180,7 +1179,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.insertion(2, 'G') m.duplication(3, 3) - assert_equal(str(m.mutated), str(Seq('ATGCCGATCG'))) + assert str(m.mutated) == str(Seq('ATGCCGATCG')) def test_adjectent_ins_dup_2(self): """ @@ -1189,7 +1188,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.insertion(2, 'G') m.duplication(2, 2) - assert_equal(str(m.mutated), str(Seq('ATTGCGATCG'))) + assert str(m.mutated) == str(Seq('ATTGCGATCG')) def test_adjectent_ins_ins_1(self): """ @@ -1198,7 +1197,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.insertion(2, 'G') m.insertion(3, 'A') - assert_equal(str(m.mutated), str(Seq('ATGCAGATCG'))) + assert str(m.mutated) == str(Seq('ATGCAGATCG')) def test_adjectent_ins_ins_2(self): """ @@ -1207,7 +1206,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.insertion(3, 'A') m.insertion(2, 'G') - assert_equal(str(m.mutated), str(Seq('ATGCAGATCG'))) + assert str(m.mutated) == str(Seq('ATGCAGATCG')) def test_ins_ins(self): """ @@ -1225,7 +1224,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.inversion(2, 2) m.inversion(3, 3) - assert_equal(str(m.mutated), str(Seq('AAGGATCG'))) + assert str(m.mutated) == str(Seq('AAGGATCG')) def test_adjecent_inv_inv_2(self): """ @@ -1234,7 +1233,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.inversion(3, 3) m.inversion(2, 2) - assert_equal(str(m.mutated), str(Seq('AAGGATCG'))) + assert str(m.mutated) == str(Seq('AAGGATCG')) def test_adjecent_dup_dup_1(self): """ @@ -1243,7 +1242,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.duplication(2, 2) m.duplication(3, 3) - assert_equal(str(m.mutated), str(Seq('ATTCCGATCG'))) + assert str(m.mutated) == str(Seq('ATTCCGATCG')) def test_adjecent_dup_dup_2(self): """ @@ -1252,7 +1251,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.duplication(3, 3) m.duplication(2, 2) - assert_equal(str(m.mutated), str(Seq('ATTCCGATCG'))) + assert str(m.mutated) == str(Seq('ATTCCGATCG')) def test_adjecent_del_inv_1(self): """ @@ -1261,7 +1260,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.deletion(2, 2) m.inversion(3, 3) - assert_equal(str(m.mutated), str(Seq('AGGATCG'))) + assert str(m.mutated) == str(Seq('AGGATCG')) def test_adjecent_del_inv_2(self): """ @@ -1270,7 +1269,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.deletion(3, 3) m.inversion(2, 2) - assert_equal(str(m.mutated), str(Seq('AAGATCG'))) + assert str(m.mutated) == str(Seq('AAGATCG')) def test_adjecent_ins_inv_1(self): """ @@ -1279,7 +1278,7 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.insertion(2, 'G') m.inversion(3, 3) - assert_equal(str(m.mutated), str(Seq('ATGGGATCG'))) + assert str(m.mutated) == str(Seq('ATGGGATCG')) def test_adjecent_ins_inv_2(self): """ @@ -1288,4 +1287,4 @@ class TestMutator(MutalyzerTest): m = self._mutator(Seq('ATCGATCG')) m.insertion(2, 'G') m.inversion(2, 2) - assert_equal(str(m.mutated), str(Seq('AAGCGATCG'))) + assert str(m.mutated) == str(Seq('AAGCGATCG')) diff --git a/tests/test_parsers_genbank.py b/tests/test_parsers_genbank.py index d66ad1af..7640c496 100644 --- a/tests/test_parsers_genbank.py +++ b/tests/test_parsers_genbank.py @@ -4,7 +4,6 @@ Tests for the mutalyzer.parsers.genbank module. #import logging; logging.basicConfig() -from nose.tools import * from mutalyzer.parsers import genbank @@ -33,4 +32,4 @@ class TestMutator(MutalyzerTest): (['a b c', 'a b c'], (-1, -1)), (['a b c d a b', 'a b'], (2, 2))] for test in tests: - assert_equal(self.gb_parser._find_mismatch(test[0]), test[1]) + assert self.gb_parser._find_mismatch(test[0]) == test[1] diff --git a/tests/test_scheduler.py b/tests/test_scheduler.py index 1fc3d5ee..a722f331 100644 --- a/tests/test_scheduler.py +++ b/tests/test_scheduler.py @@ -10,7 +10,6 @@ import StringIO #import logging; logging.basicConfig() from Bio import Entrez from mock import patch -from nose.tools import * from mutalyzer.config import settings from mutalyzer.db.models import BatchJob, BatchQueueItem @@ -42,19 +41,18 @@ class TestScheduler(MutalyzerTest): batch_job = BatchJob.query.filter_by(result_id=result_id).one() left = batch_job.batch_queue_items.count() - assert_equal(left, len(variants)) + assert left == len(variants) scheduler.process() left = batch_job.batch_queue_items.count() - assert_equal(left, 0) + assert left == 0 filename = 'batch-job-%s.txt' % result_id result = open(os.path.join(settings.CACHE_DIR, filename)) next(result) # Header. - assert_equal(expected, - [line.strip().split('\t') for line in result]) + assert expected == [line.strip().split('\t') for line in result] def test_syntax_checker(self): """ diff --git a/tests/test_services_json.py b/tests/test_services_json.py index f5b1a42c..461e8171 100644 --- a/tests/test_services_json.py +++ b/tests/test_services_json.py @@ -3,7 +3,6 @@ Tests for the JSON interface to Mutalyzer. """ -from nose.tools import * import simplejson as json from spyne.server.null import NullServer import mutalyzer @@ -39,7 +38,7 @@ class TestServicesJson(MutalyzerTest): Running checkSyntax with a valid variant name should return True. """ r = self._call('checkSyntax', variant='AB026906.1:c.274G>T') - assert_equal(r, {'valid': True, 'messages': []}) + assert r == {'valid': True, 'messages': []} def test_checksyntax_invalid(self): """ @@ -47,7 +46,7 @@ class TestServicesJson(MutalyzerTest): and give at least one error message. """ r = self._call('checkSyntax', variant='0:abcd') - assert_equal(r['valid'], False) + assert r['valid'] == False assert len(r['messages']) >= 1 def test_checksyntax_empty(self): @@ -57,7 +56,7 @@ class TestServicesJson(MutalyzerTest): # The validator doesn't work with NullServer, so we cannot do this # test. See https://github.com/arskom/spyne/issues/318 #r = self._call('checkSyntax') - #assert_equal(r['faultcode'], 'Client.ValidationError') + #assert r['faultcode'] == 'Client.ValidationError' pass @fix(database, hg19, hg19_transcript_mappings) @@ -68,14 +67,14 @@ class TestServicesJson(MutalyzerTest): """ r = self._call('transcriptInfo', LOVD_ver='123', build='hg19', accNo='NM_002001.2') - assert_equal(r['trans_start'], -99) - assert_equal(r['trans_stop'], 1066) - assert_equal(r['CDS_stop'], 774) + assert r['trans_start'] == -99 + assert r['trans_stop'] == 1066 + assert r['CDS_stop'] == 774 def test_info(self): """ Running the info method should give us some version information. """ r = self._call('info') - assert_equal(type(r['versionParts']), list) - assert_equal(r['version'], mutalyzer.__version__) + assert type(r['versionParts']) == list + assert r['version'] == mutalyzer.__version__ diff --git a/tests/test_services_soap.py b/tests/test_services_soap.py index 53344ca5..7bd68831 100644 --- a/tests/test_services_soap.py +++ b/tests/test_services_soap.py @@ -11,7 +11,7 @@ import tempfile from Bio import Entrez from mock import patch -from nose.tools import * +import pytest from spyne.server.null import NullServer from spyne.model.fault import Fault from suds.client import Client @@ -77,14 +77,14 @@ class TestServicesSoap(MutalyzerTest): Running the ping method should return 'pong'. """ r = self._call('ping') - assert_equal(r, 'pong') + assert r == 'pong' def test_checksyntax_valid(self): """ Running checkSyntax with a valid variant name should return True. """ r = self._call('checkSyntax', 'AB026906.1:c.274G>T') - assert_equal(r.valid, True) + assert r.valid == True def test_checksyntax_invalid(self): """ @@ -92,10 +92,9 @@ class TestServicesSoap(MutalyzerTest): and give at least one error message. """ r = self._call('checkSyntax', '0:abcd') - assert_equal(r.valid, False) + assert r.valid == False assert len(r.messages.SoapMessage) >= 1 - @raises(Fault) def test_checksyntax_empty(self): """ Running checkSyntax with no variant name should raise exception. @@ -104,7 +103,8 @@ class TestServicesSoap(MutalyzerTest): # these type of tests. However, in this case we implemented our own # check instead of relying on the validator. # See https://github.com/arskom/spyne/issues/318 - self._call('checkSyntax') + with pytest.raises(Fault): + self._call('checkSyntax') @fix(database, hg19, hg19_transcript_mappings) def test_transcriptinfo_valid(self): @@ -114,9 +114,9 @@ class TestServicesSoap(MutalyzerTest): """ r = self._call('transcriptInfo', LOVD_ver='123', build='hg19', accNo='NM_002001.2') - assert_equal(r.trans_start, -99) - assert_equal(r.trans_stop, 1066) - assert_equal(r.CDS_stop, 774) + assert r.trans_start == -99 + assert r.trans_stop == 1066 + assert r.CDS_stop == 774 @fix(database, hg19, hg19_transcript_mappings) def test_numberconversion_gtoc_valid(self): @@ -126,7 +126,7 @@ class TestServicesSoap(MutalyzerTest): """ r = self._call('numberConversion', build='hg19', variant='NC_000001.10:g.159272155del') - assert_equal(type(r.string), list) + assert type(r.string) == list assert 'NM_002001.2:c.1del' in r.string @fix(database, hg19, hg19_transcript_mappings) @@ -137,7 +137,7 @@ class TestServicesSoap(MutalyzerTest): """ r = self._call('numberConversion', build='hg19', variant='NM_002001.2:c.1del') - assert_equal(type(r.string), list) + assert type(r.string) == list assert 'NC_000001.10:g.159272155del' in r.string @fix(database, hg19, hg19_transcript_mappings) @@ -148,7 +148,7 @@ class TestServicesSoap(MutalyzerTest): """ r = self._call('numberConversion', build='hg19', variant='NC_000023.10:g.32827640G>A', gene='DMD') - assert_equal(type(r.string), list) + assert type(r.string) == list assert 'NM_004007.2:c.250C>T' in r.string assert 'NM_004011.3:c.-397314C>T' in r.string assert 'NM_004019.2:c.-1542694C>T' in r.string @@ -161,7 +161,7 @@ class TestServicesSoap(MutalyzerTest): """ r = self._call('numberConversion', build='hg19', variant='chr7:g.345T>C') - assert_false(r) + assert not r @fix(database, hg19, hg19_transcript_mappings) def test_numberconversion_gtoc_required_gene(self): @@ -172,7 +172,7 @@ class TestServicesSoap(MutalyzerTest): """ r = self._call('numberConversion', build='hg19', variant='chr7:g.345T>C', gene='LOC100132858') - assert_equal(type(r.string), list) + assert type(r.string) == list # Fix for r536: disable the -u and +d convention. #assert 'XM_001715131.2:c.1155+d19483A>G' in r.string assert 'XM_001715131.2:c.*19483A>G' in r.string @@ -185,7 +185,7 @@ class TestServicesSoap(MutalyzerTest): """ r = self._call('getTranscriptsByGeneName', build='hg19', name='DMD') - assert_equal(type(r.string), list) + assert type(r.string) == list for t in ['NM_004011.3', 'NM_004019.2', 'NM_004007.2']: @@ -199,7 +199,7 @@ class TestServicesSoap(MutalyzerTest): """ r = self._call('getTranscriptsByGeneName', build='hg19', name='BOGUSGENE') - assert_false(r) + assert not r @fix(database, cache('AF230870.1')) def test_gettranscriptsandinfo_valid(self): @@ -208,7 +208,7 @@ class TestServicesSoap(MutalyzerTest): give a list of TranscriptInfo objects. """ r = self._call('getTranscriptsAndInfo', 'AF230870.1') - assert_equal(type(r.TranscriptInfo), list) + assert type(r.TranscriptInfo) == list names = [t.name for t in r.TranscriptInfo] for t in ['mtmC2_v001', 'mtmB2_v001']: @@ -222,7 +222,7 @@ class TestServicesSoap(MutalyzerTest): to the gene. """ r = self._call('getTranscriptsAndInfo', 'AL449423.14', 'CDKN2A') - assert_equal(type(r.TranscriptInfo), list) + assert type(r.TranscriptInfo) == list names = [t.name for t in r.TranscriptInfo] for t in ['CDKN2A_v008', 'CDKN2A_v007']: @@ -231,7 +231,7 @@ class TestServicesSoap(MutalyzerTest): 'CDKN2B_v001', 'MTAP_v005', 'C9orf53_v001']: - assert_false(t in names) + assert t not in names @fix(database, hg19, hg19_transcript_mappings) def test_gettranscriptsmapping(self): @@ -241,7 +241,7 @@ class TestServicesSoap(MutalyzerTest): """ r = self._call('getTranscriptsMapping', 'hg19', 'chrX', 31200000, 31210000, 1) - assert_equal(type(r.TranscriptMappingInfo), list) + assert type(r.TranscriptMappingInfo) == list names = [t.name for t in r.TranscriptMappingInfo] for t in ('NM_004011', 'NM_004019', @@ -255,13 +255,13 @@ class TestServicesSoap(MutalyzerTest): """ r = self._call('mappingInfo', '3.0-beta-06', 'hg19', 'NM_001100.3', 'g.112037014G>T') - assert_equal(r.endoffset, 117529978) - assert_equal(r.start_g, 112037014) - assert_equal(r.startoffset, 117529978) - assert_equal(r.mutationType, "subst") - assert_equal(r.end_g, 112037014) - assert_equal(r.startmain, 1388) - assert_equal(r.endmain, 1388) + assert r.endoffset == 117529978 + assert r.start_g == 112037014 + assert r.startoffset == 117529978 + assert r.mutationType == "subst" + assert r.end_g == 112037014 + assert r.startmain == 1388 + assert r.endmain == 1388 @fix(database, hg19, hg19_transcript_mappings) def test_mappinginfo(self): @@ -270,13 +270,13 @@ class TestServicesSoap(MutalyzerTest): """ r = self._call('mappingInfo', '3.0-beta-06', 'hg19', 'NM_002001.2', 'g.159272168G>T') - assert_equal(r.endoffset, 0) - assert_equal(r.start_g, 159272168) - assert_equal(r.startoffset, 0) - assert_equal(r.mutationType, 'subst') - assert_equal(r.end_g, 159272168) - assert_equal(r.startmain, 14) - assert_equal(r.endmain, 14) + assert r.endoffset == 0 + assert r.start_g == 159272168 + assert r.startoffset == 0 + assert r.mutationType == 'subst' + assert r.end_g == 159272168 + assert r.startmain == 14 + assert r.endmain == 14 @fix(database, hg19, hg19_transcript_mappings) def test_mappinginfo_compound(self): @@ -286,13 +286,13 @@ class TestServicesSoap(MutalyzerTest): """ r = self._call('mappingInfo', '3.0-beta-06', 'hg19', 'NM_002001.2', 'g.[159272168G>T;159272174T>A]') - assert_equal(r.endoffset, 0) - assert_equal(r.start_g, 159272168) - assert_equal(r.startoffset, 0) - assert_equal(r.mutationType, 'compound') - assert_equal(r.end_g, 159272174) - assert_equal(r.startmain, 14) - assert_equal(r.endmain, 20) + assert r.endoffset == 0 + assert r.start_g == 159272168 + assert r.startoffset == 0 + assert r.mutationType == 'compound' + assert r.end_g == 159272174 + assert r.startmain == 14 + assert r.endmain == 20 @fix(database, hg19, hg19_transcript_mappings) def test_mappinginfo_reverse(self): @@ -302,13 +302,13 @@ class TestServicesSoap(MutalyzerTest): """ r = self._call('mappingInfo', '3.0-beta-06', 'hg19', 'NM_004011.3', 'g.31152229_31152239del') - assert_equal(r.endoffset, 0) - assert_equal(r.start_g, 31152229) - assert_equal(r.startoffset, 0) - assert_equal(r.mutationType, 'del') - assert_equal(r.end_g, 31152239) - assert_equal(r.startmain, 6981) - assert_equal(r.endmain, 6971) + assert r.endoffset == 0 + assert r.start_g == 31152229 + assert r.startoffset == 0 + assert r.mutationType == 'del' + assert r.end_g == 31152239 + assert r.startmain == 6981 + assert r.endmain == 6971 @fix(database, hg19, hg19_transcript_mappings) def test_mappinginfo_compound_reverse(self): @@ -318,21 +318,21 @@ class TestServicesSoap(MutalyzerTest): """ r = self._call('mappingInfo', '3.0-beta-06', 'hg19', 'NM_004011.3', 'g.[31152229_31152232del;31152235_31152239del]') - assert_equal(r.endoffset, 0) - assert_equal(r.start_g, 31152229) - assert_equal(r.startoffset, 0) - assert_equal(r.mutationType, 'compound') - assert_equal(r.end_g, 31152239) - assert_equal(r.startmain, 6981) - assert_equal(r.endmain, 6971) + assert r.endoffset == 0 + assert r.start_g == 31152229 + assert r.startoffset == 0 + assert r.mutationType == 'compound' + assert r.end_g == 31152239 + assert r.startmain == 6981 + assert r.endmain == 6971 def test_info(self): """ Running the info method should give us some version information. """ r = self._call('info') - assert_equal(type(r.versionParts.string), list) - assert_equal(r.version, mutalyzer.__version__) + assert type(r.versionParts.string) == list + assert r.version == mutalyzer.__version__ @fix(database, cache('AB026906.1', 'AL449423.14', 'NM_003002.2')) def test_getcache(self): @@ -346,7 +346,7 @@ class TestServicesSoap(MutalyzerTest): sync = CacheSync(output) r = self._call('getCache', created_since) - assert_equal(len(r.CacheEntry), 3) + assert len(r.CacheEntry) == 3 def test_getdbsnpdescriptions(self): """ @@ -375,7 +375,7 @@ class TestServicesSoap(MutalyzerTest): """ r = self._call('getTranscripts', build='hg19', chrom='chrX', pos=32237295) - assert_equal(type(r.string), list) + assert type(r.string) == list for t in ['NM_004011', 'NM_004007']: assert t in r.string @@ -388,7 +388,7 @@ class TestServicesSoap(MutalyzerTest): """ r = self._call('getTranscripts', build='hg19', chrom='chrX', pos=32237295, versions=True) - assert_equal(type(r.string), list) + assert type(r.string) == list for t in ['NM_004011.3', 'NM_004007.2']: assert t in r.string @@ -399,8 +399,8 @@ class TestServicesSoap(MutalyzerTest): Just a runMutalyzer test. """ r = self._call('runMutalyzer', 'NM_003002.2:c.274G>T') - assert_equal(r.errors, 0) - assert_equal(r.genomicDescription, 'NM_003002.2:n.335G>T') + assert r.errors == 0 + assert r.genomicDescription == 'NM_003002.2:n.335G>T' assert 'NM_003002.2(SDHD_v001):c.274G>T' in r.transcriptDescriptions.string @fix(database) @@ -421,13 +421,13 @@ class TestServicesSoap(MutalyzerTest): with patch.object(Entrez, 'efetch', mock_efetch): r = self._call('runMutalyzer', 'NM_003002:c.274G>T') - assert_equal(r.errors, 0) - assert_equal(r.referenceId, 'NM_003002.2') - assert_equal(r.sourceId, 'NM_003002.2') - assert_equal(r.sourceAccession, 'NM_003002') - assert_equal(r.sourceVersion, '2') - assert_equal(r.sourceGi, '222352156') - assert_equal(r.molecule, 'n') + assert r.errors == 0 + assert r.referenceId == 'NM_003002.2' + assert r.sourceId == 'NM_003002.2' + assert r.sourceAccession == 'NM_003002' + assert r.sourceVersion == '2' + assert r.sourceGi == '222352156' + assert r.molecule == 'n' @fix(database, cache('NM_003002.2')) def test_runmutalyzer_reference_info_nm_version(self): @@ -435,13 +435,13 @@ class TestServicesSoap(MutalyzerTest): Get reference info for an NM variant with version. """ r = self._call('runMutalyzer', 'NM_003002.2:c.274G>T') - assert_equal(r.errors, 0) - assert_equal(r.referenceId, 'NM_003002.2') - assert_equal(r.sourceId, 'NM_003002.2') - assert_equal(r.sourceAccession, 'NM_003002') - assert_equal(r.sourceVersion, '2') - assert_equal(r.sourceGi, '222352156') - assert_equal(r.molecule, 'n') + assert r.errors == 0 + assert r.referenceId == 'NM_003002.2' + assert r.sourceId == 'NM_003002.2' + assert r.sourceAccession == 'NM_003002' + assert r.sourceVersion == '2' + assert r.sourceGi == '222352156' + assert r.molecule == 'n' @fix(database, cache('LRG_1')) def test_runmutalyzer_reference_info_lrg(self): @@ -449,10 +449,10 @@ class TestServicesSoap(MutalyzerTest): Get reference info for an LRG variant. """ r = self._call('runMutalyzer', 'LRG_1t1:c.266G>T') - assert_equal(r.errors, 0) - assert_equal(r.referenceId, 'LRG_1') - assert_equal(r.sourceId, 'LRG_1') - assert_equal(r.molecule, 'g') + assert r.errors == 0 + assert r.referenceId == 'LRG_1' + assert r.sourceId == 'LRG_1' + assert r.molecule == 'g' @fix(database, cache('NG_012772.1')) def test_runmutalyzer_reference_info_ng(self): @@ -472,13 +472,13 @@ class TestServicesSoap(MutalyzerTest): with patch.object(Entrez, 'efetch', mock_efetch): r = self._call('runMutalyzer', 'NG_012772:g.18964del') - assert_equal(r.errors, 0) - assert_equal(r.referenceId, 'NG_012772.1') - assert_equal(r.sourceId, 'NG_012772.1') - assert_equal(r.sourceAccession, 'NG_012772') - assert_equal(r.sourceVersion, '1') - assert_equal(r.sourceGi, '256574794') - assert_equal(r.molecule, 'g') + assert r.errors == 0 + assert r.referenceId == 'NG_012772.1' + assert r.sourceId == 'NG_012772.1' + assert r.sourceAccession == 'NG_012772' + assert r.sourceVersion == '1' + assert r.sourceGi == '256574794' + assert r.molecule == 'g' @fix(database, cache('NG_009105.1')) def test_runmutalyzer_reference_info_ng_version(self): @@ -486,13 +486,13 @@ class TestServicesSoap(MutalyzerTest): Get reference info for an NG variant with version. """ r = self._call('runMutalyzer', 'NG_009105.1:g.18964del') - assert_equal(r.errors, 0) - assert_equal(r.referenceId, 'NG_009105.1') - assert_equal(r.sourceId, 'NG_009105.1') - assert_equal(r.sourceAccession, 'NG_009105') - assert_equal(r.sourceVersion, '1') - assert_equal(r.sourceGi, '216548283') - assert_equal(r.molecule, 'g') + assert r.errors == 0 + assert r.referenceId == 'NG_009105.1' + assert r.sourceId == 'NG_009105.1' + assert r.sourceAccession == 'NG_009105' + assert r.sourceVersion == '1' + assert r.sourceGi == '216548283' + assert r.molecule == 'g' @fix(database, cache('NG_012772.1')) def test_runmutalyzer_reference_info_gi(self): @@ -500,13 +500,13 @@ class TestServicesSoap(MutalyzerTest): Get reference info for a GI variant. """ r = self._call('runMutalyzer', 'gi256574794:g.18964del') - assert_equal(r.errors, 0) - assert_equal(r.referenceId, 'NG_012772.1') - assert_equal(r.sourceId, 'NG_012772.1') - assert_equal(r.sourceAccession, 'NG_012772') - assert_equal(r.sourceVersion, '1') - assert_equal(r.sourceGi, '256574794') - assert_equal(r.molecule, 'g') + assert r.errors == 0 + assert r.referenceId == 'NG_012772.1' + assert r.sourceId == 'NG_012772.1' + assert r.sourceAccession == 'NG_012772' + assert r.sourceVersion == '1' + assert r.sourceGi == '256574794' + assert r.molecule == 'g' @fix(database, cache('NM_000143.3')) def test_runmutalyzer_exons(self): @@ -514,7 +514,7 @@ class TestServicesSoap(MutalyzerTest): Exon table in runMutalyzer output. """ r = self._call('runMutalyzer', 'NM_000143.3:c.630_636del') - assert_equal(r.errors, 0) + assert r.errors == 0 expected_exons = [(1, 195, '-63', '132'), (196, 330, '133', '267'), (331, 441, '268', '378'), @@ -525,10 +525,9 @@ class TestServicesSoap(MutalyzerTest): (1172, 1299, '1109', '1236'), (1300, 1453, '1237', '1390'), (1454, 1867, '1391', '*271')] - assert_equal(len(r.exons.ExonInfo), len(expected_exons)) + assert len(r.exons.ExonInfo) == len(expected_exons) for exon, expected_exon in zip(r.exons.ExonInfo, expected_exons): - assert_equal((exon.gStart, exon.gStop, exon.cStart, exon.cStop), - expected_exon) + assert (exon.gStart, exon.gStop, exon.cStart, exon.cStop) == expected_exon @fix(database, cache('AB026906.1', 'NM_003002.2', 'AL449423.14')) def test_batchjob(self): @@ -553,8 +552,7 @@ class TestServicesSoap(MutalyzerTest): assert int(result) == 0 result = self._call('getBatchJob', job_id) - assert_equal(len(result.decode('base64').strip().split('\n')) - 1, - len(variants)) + assert len(result.decode('base64').strip().split('\n')) - 1 == len(variants) @fix(database) def test_batchjob_newlines_unix(self): diff --git a/tests/test_variantchecker.py b/tests/test_variantchecker.py index bd33d09d..1b30786b 100644 --- a/tests/test_variantchecker.py +++ b/tests/test_variantchecker.py @@ -4,7 +4,6 @@ Tests for the variantchecker module. #import logging; logging.basicConfig() -from nose.tools import * from mutalyzer.output import Output from mutalyzer.Retriever import GenBankRetriever @@ -42,8 +41,8 @@ class TestVariantchecker(MutalyzerTest): level. """ check_variant('AL449423.14(CDKN2A_v001):c.161_163del', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'AL449423.14:g.61937_61939del') + assert (self.output.getIndexedOutput('genomicDescription', 0) == + 'AL449423.14:g.61937_61939del') assert 'AL449423.14(CDKN2A_v001):c.161_163del' \ in self.output.getOutput('descriptions') assert 'AL449423.14(CDKN2A_i001):p.(Met54_Gly55delinsSer)' \ @@ -57,8 +56,8 @@ class TestVariantchecker(MutalyzerTest): level. """ check_variant('AL449423.14(CDKN2A_v001):c.161_162insATC', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'AL449423.14:g.61938_61939insGAT') + assert (self.output.getIndexedOutput('genomicDescription', 0) == + 'AL449423.14:g.61938_61939insGAT') assert 'AL449423.14(CDKN2A_v001):c.161_162insATC' \ in self.output.getOutput('descriptions') assert 'AL449423.14(CDKN2A_i001):p.(Met54delinsIleSer)' \ @@ -72,8 +71,8 @@ class TestVariantchecker(MutalyzerTest): on protein level. """ check_variant('AL449423.14(CDKN2A_v001):c.161_162ins[ATC]', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'AL449423.14:g.61938_61939insGAT') + assert (self.output.getIndexedOutput('genomicDescription', 0) == + 'AL449423.14:g.61938_61939insGAT') assert 'AL449423.14(CDKN2A_v001):c.161_162insATC' \ in self.output.getOutput('descriptions') assert 'AL449423.14(CDKN2A_i001):p.(Met54delinsIleSer)' \ @@ -88,8 +87,7 @@ class TestVariantchecker(MutalyzerTest): """ check_variant('AL449423.14(CDKN2A_v001):c.161_162delinsATCCC', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'AL449423.14:g.61938_61939delinsGGGAT') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'AL449423.14:g.61938_61939delinsGGGAT' assert 'AL449423.14(CDKN2A_v001):c.161_162delinsATCCC' \ in self.output.getOutput('descriptions') assert 'AL449423.14(CDKN2A_i001):p.(Met54delinsAsnPro)' \ @@ -104,8 +102,7 @@ class TestVariantchecker(MutalyzerTest): """ check_variant('AL449423.14(CDKN2A_v001):c.161_162delins[ATCCC]', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'AL449423.14:g.61938_61939delinsGGGAT') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'AL449423.14:g.61938_61939delinsGGGAT' assert 'AL449423.14(CDKN2A_v001):c.161_162delinsATCCC' \ in self.output.getOutput('descriptions') assert 'AL449423.14(CDKN2A_i001):p.(Met54delinsAsnPro)' \ @@ -120,8 +117,7 @@ class TestVariantchecker(MutalyzerTest): """ check_variant('AL449423.14(CDKN2A_v001):c.161_162delTGinsATCCC', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'AL449423.14:g.61938_61939delinsGGGAT') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'AL449423.14:g.61938_61939delinsGGGAT' assert 'AL449423.14(CDKN2A_v001):c.161_162delinsATCCC' \ in self.output.getOutput('descriptions') assert 'AL449423.14(CDKN2A_i001):p.(Met54delinsAsnPro)' \ @@ -137,8 +133,7 @@ class TestVariantchecker(MutalyzerTest): """ check_variant('AL449423.14(CDKN2A_v001):c.161_162delTGins[ATCCC]', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'AL449423.14:g.61938_61939delinsGGGAT') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'AL449423.14:g.61938_61939delinsGGGAT' assert 'AL449423.14(CDKN2A_v001):c.161_162delinsATCCC' \ in self.output.getOutput('descriptions') assert 'AL449423.14(CDKN2A_i001):p.(Met54delinsAsnPro)' \ @@ -215,7 +210,7 @@ class TestVariantchecker(MutalyzerTest): """ check_variant('NM_003002.2:c.274del', self.output) wroll = self.output.getMessagesWithErrorCode('WROLLFORWARD') - assert_equal(len(wroll), 0) + assert len(wroll) == 0 @fix(cache('NM_000088.3')) def test_no_roll_splice(self): @@ -226,7 +221,7 @@ class TestVariantchecker(MutalyzerTest): wrollback = self.output.getMessagesWithErrorCode('IROLLBACK') assert len(wrollback) > 0 wroll = self.output.getMessagesWithErrorCode('WROLLFORWARD') - assert_equal(len(wroll), 0) + assert len(wroll) == 0 @fix(cache('NM_000088.3')) def test_partial_roll_splice(self): @@ -280,8 +275,8 @@ class TestVariantchecker(MutalyzerTest): """ check_variant('AL449423.14:g.65470_65471insTAC', self.output) assert 'AL449423.14(CDKN2A_v001):c.99_100insTAG' in self.output.getOutput('descriptions') - assert_equal ('AL449423.14:g.65471_65472insACT', self.output.getIndexedOutput('genomicDescription', 0, '')) - assert_equal(len(self.output.getMessagesWithErrorCode('WROLLFORWARD')), 1) + assert 'AL449423.14:g.65471_65472insACT' == self.output.getIndexedOutput('genomicDescription', 0, '') + assert len(self.output.getMessagesWithErrorCode('WROLLFORWARD')) == 1 @fix(cache('AL449423.14')) def test_roll_reverse_ins(self): @@ -291,8 +286,8 @@ class TestVariantchecker(MutalyzerTest): """ check_variant('AL449423.14:g.65471_65472insACT', self.output) assert 'AL449423.14(CDKN2A_v001):c.99_100insTAG' in self.output.getOutput('descriptions') - assert_equal ('AL449423.14:g.65471_65472insACT', self.output.getIndexedOutput('genomicDescription', 0, '')) - assert_equal(len(self.output.getMessagesWithErrorCode('WROLLFORWARD')), 0) + assert 'AL449423.14:g.65471_65472insACT' == self.output.getIndexedOutput('genomicDescription', 0, '') + assert len(self.output.getMessagesWithErrorCode('WROLLFORWARD')) == 0 @fix(cache('AL449423.14')) def test_roll_message_forward(self): @@ -301,8 +296,8 @@ class TestVariantchecker(MutalyzerTest): strand (forward). """ check_variant('AL449423.14:g.65470_65471insTAC', self.output) - assert_equal(len(self.output.getMessagesWithErrorCode('WROLLFORWARD')), 1) - assert_equal(len(self.output.getMessagesWithErrorCode('WROLLREVERSE')), 0) + assert len(self.output.getMessagesWithErrorCode('WROLLFORWARD')) == 1 + assert len(self.output.getMessagesWithErrorCode('WROLLREVERSE')) == 0 @fix(cache('AL449423.14')) def test_roll_message_reverse(self): @@ -311,8 +306,8 @@ class TestVariantchecker(MutalyzerTest): strand (reverse). """ check_variant('AL449423.14(CDKN2A_v001):c.98_99insGTA', self.output) - assert_equal(len(self.output.getMessagesWithErrorCode('WROLLFORWARD')), 0) - assert_equal(len(self.output.getMessagesWithErrorCode('WROLLREVERSE')), 1) + assert len(self.output.getMessagesWithErrorCode('WROLLFORWARD')) == 0 + assert len(self.output.getMessagesWithErrorCode('WROLLREVERSE')) == 1 @fix(cache('NM_000143.3')) def test_ins_cds_start(self): @@ -320,7 +315,7 @@ class TestVariantchecker(MutalyzerTest): Insertion on CDS start boundary should not be included in CDS. """ check_variant('NM_000143.3:c.-1_1insCAT', self.output) - assert_equal(self.output.getIndexedOutput("newprotein", 0), None) + assert self.output.getIndexedOutput("newprotein", 0) == None # Todo: Is this a good test? @fix(cache('NM_000143.3')) @@ -329,7 +324,7 @@ class TestVariantchecker(MutalyzerTest): Insertion after CDS start boundary should be included in CDS. """ check_variant('NM_000143.3:c.1_2insCAT', self.output) - assert_equal(self.output.getIndexedOutput("newprotein", 0), '?') + assert self.output.getIndexedOutput("newprotein", 0) == '?' # Todo: Is this a good test? @fix(cache('NG_012772.1')) @@ -339,7 +334,7 @@ class TestVariantchecker(MutalyzerTest): """ check_variant('NG_012772.1(BRCA2_v001):c.632-5_670del', self.output) assert len(self.output.getMessagesWithErrorCode('WOVERSPLICE')) > 0 - assert_equal(self.output.getOutput('removedSpliceSites'), []) + assert self.output.getOutput('removedSpliceSites') == [] # Todo: For now, the following is how to check if no protein # prediction is done. assert not self.output.getOutput('newprotein') @@ -351,7 +346,7 @@ class TestVariantchecker(MutalyzerTest): """ check_variant('NG_012772.1(BRCA2_v001):c.632-5_681+7del', self.output) assert len(self.output.getMessagesWithErrorCode('WOVERSPLICE')) > 0 - assert_equal(self.output.getOutput('removedSpliceSites'), [2]) + assert self.output.getOutput('removedSpliceSites') == [2] # Todo: For now, the following is how to check if protein # prediction is done. assert self.output.getOutput('newprotein') @@ -362,8 +357,8 @@ class TestVariantchecker(MutalyzerTest): Deletion of exactly an exon should be possible. """ check_variant('NG_012772.1(BRCA2_v001):c.632_681del', self.output) - assert_equal(len(self.output.getMessagesWithErrorCode('WOVERSPLICE')), 0) - assert_equal(self.output.getOutput('removedSpliceSites'), [2]) + assert len(self.output.getMessagesWithErrorCode('WOVERSPLICE')) == 0 + assert self.output.getOutput('removedSpliceSites') == [2] # Todo: For now, the following is how to check if protein # prediction is done. assert self.output.getOutput('newprotein') @@ -380,7 +375,7 @@ class TestVariantchecker(MutalyzerTest): """ check_variant('NG_012772.1(BRCA2_v001):c.68-7_316+7del', self.output) assert len(self.output.getMessagesWithErrorCode('WOVERSPLICE')) > 0 - assert_equal(self.output.getOutput('removedSpliceSites'), [2]) + assert self.output.getOutput('removedSpliceSites') == [2] # Todo: For now, the following is how to check if protein # prediction is done. assert self.output.getOutput('newprotein') @@ -393,7 +388,7 @@ class TestVariantchecker(MutalyzerTest): """ check_variant('NG_012772.1(BRCA2_v001):c.632-5_793+7del', self.output) assert len(self.output.getMessagesWithErrorCode('WOVERSPLICE')) > 0 - assert_equal(self.output.getOutput('removedSpliceSites'), [4]) + assert self.output.getOutput('removedSpliceSites') == [4] # Todo: For now, the following is how to check if protein # prediction is done. assert self.output.getOutput('newprotein') @@ -406,7 +401,7 @@ class TestVariantchecker(MutalyzerTest): """ check_variant('NG_012772.1(BRCA2_v001):c.622_674del', self.output) assert len(self.output.getMessagesWithErrorCode('WOVERSPLICE')) > 0 - assert_equal(self.output.getOutput('removedSpliceSites'), [2]) + assert self.output.getOutput('removedSpliceSites') == [2] # Todo: For now, the following is how to check if protein # prediction is done. assert self.output.getOutput('newprotein') @@ -418,8 +413,8 @@ class TestVariantchecker(MutalyzerTest): exons). """ check_variant('NG_012772.1(BRCA2_v001):c.681+1_682-1del', self.output) - assert_equal(self.output.getMessagesWithErrorCode('WOVERSPLICE'), []) - assert_equal(self.output.getOutput('removedSpliceSites'), [2]) + assert self.output.getMessagesWithErrorCode('WOVERSPLICE') == [] + assert self.output.getOutput('removedSpliceSites') == [2] # Note: The protein prediction is done, but 'newprotein' is not set # because we have no change. So to check if the prediction is done, we # check if 'oldprotein' is set and to check if the prediction is @@ -435,7 +430,7 @@ class TestVariantchecker(MutalyzerTest): """ check_variant('NG_012772.1(BRCA2_v001):c.622_672del', self.output) assert len(self.output.getMessagesWithErrorCode('WOVERSPLICE')) > 0 - assert_equal(self.output.getOutput('removedSpliceSites'), [2]) + assert self.output.getOutput('removedSpliceSites') == [2] # Todo: For now, the following is how to check if protein # prediction is done. assert self.output.getOutput('newprotein') @@ -453,8 +448,7 @@ class TestVariantchecker(MutalyzerTest): # prediction is done. assert self.output.getOutput('newprotein') # Genomic positions should be centered in flanking introns and unsure. - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_012772.1:g.(17550_19725)del') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_012772.1:g.(17550_19725)del' assert 'NG_012772.1(BRCA2_v001):c.632-?_681+?del' \ in self.output.getOutput('descriptions') assert 'NG_012772.1(BRCA2_i001):p.(Val211Glufs*10)' \ @@ -479,8 +473,7 @@ class TestVariantchecker(MutalyzerTest): # prediction is done. assert self.output.getOutput('newprotein') # Genomic positions should be centered in flanking introns and unsure. - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_012772.1:g.(7324_11720)del') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_012772.1:g.(7324_11720)del' assert 'NG_012772.1(BRCA2_v001):c.68-?_316+?del' \ in self.output.getOutput('descriptions') # Todo: .c notation should still be c.632-?_681+?del, but what about @@ -500,8 +493,7 @@ class TestVariantchecker(MutalyzerTest): # prediction is done. assert self.output.getOutput('newprotein') # Genomic positions should be centered in flanking introns and unsure. - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_012772.1:g.[(17550_19725)del;19017del]') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_012772.1:g.[(17550_19725)del;19017del]' assert 'NG_012772.1(BRCA2_v001):c.[632-?_681+?del;681+4del]' \ in self.output.getOutput('descriptions') # Todo: .c notation should still be c.632-?_681+?del, but what about @@ -521,8 +513,7 @@ class TestVariantchecker(MutalyzerTest): # prediction is done. assert self.output.getOutput('newprotein') # Genomic positions should be centered in flanking introns and unsure. - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'AL449423.14:g.(60314_63683)del') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'AL449423.14:g.(60314_63683)del' assert 'AL449423.14(CDKN2A_v001):c.151-?_457+?del' \ in self.output.getOutput('descriptions') # Todo: .c notation should still be c.632-?_681+?del, but what about @@ -538,8 +529,8 @@ class TestVariantchecker(MutalyzerTest): """ #check_variant('NM_018723.3:c.758_890del', self.output) check_variant('NM_000143.3:c.739_904del', self.output) - assert_equal(len(self.output.getMessagesWithErrorCode('WOVERSPLICE')), 0) - assert_equal(self.output.getOutput('removedSpliceSites'), [2]) + assert len(self.output.getMessagesWithErrorCode('WOVERSPLICE')) == 0 + assert self.output.getOutput('removedSpliceSites') == [2] # Todo: For now, the following is how to check if protein # prediction is done. assert self.output.getOutput('newprotein') @@ -550,8 +541,7 @@ class TestVariantchecker(MutalyzerTest): Insertion of a sequence. """ check_variant('NG_008939.1:g.5207_5208insGTCCTGTGCTCATTATCTGGC', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_008939.1:g.5207_5208insGTCCTGTGCTCATTATCTGGC') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_008939.1:g.5207_5208insGTCCTGTGCTCATTATCTGGC' assert 'NG_008939.1(PCCB_v001):c.156_157insGTCCTGTGCTCATTATCTGGC' \ in self.output.getOutput('descriptions') @@ -562,8 +552,7 @@ class TestVariantchecker(MutalyzerTest): Insertion of a sequence on reverse strand. """ check_variant('NG_012337.1(TIMM8B_v001):c.12_13insGATC', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_012337.1:g.4911_4912insATCG') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_012337.1:g.4911_4912insATCG' assert 'NG_012337.1(TIMM8B_v001):c.12_13insGATC' \ in self.output.getOutput('descriptions') @@ -573,11 +562,10 @@ class TestVariantchecker(MutalyzerTest): Insertion of a range. """ check_variant('NG_008939.1:g.5207_5208ins4300_4320', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_008939.1:g.5207_5208insGTCCTGTGCTCATTATCTGGC') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_008939.1:g.5207_5208insGTCCTGTGCTCATTATCTGGC' assert 'NG_008939.1(PCCB_v001):c.156_157insGTCCTGTGCTCATTATCTGGC' \ in self.output.getOutput('descriptions') - assert_equal(len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')), 0) + assert len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')) == 0 @fix(cache('NG_008939.1')) def test_ins_range_inv(self): @@ -585,11 +573,10 @@ class TestVariantchecker(MutalyzerTest): Insertion of an inverse range. """ check_variant('NG_008939.1:g.5207_5208ins4300_4320inv', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_008939.1:g.5207_5208insGCCAGATAATGAGCACAGGAC') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_008939.1:g.5207_5208insGCCAGATAATGAGCACAGGAC' assert 'NG_008939.1(PCCB_v001):c.156_157insGCCAGATAATGAGCACAGGAC' \ in self.output.getOutput('descriptions') - assert_equal(len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')), 0) + assert len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')) == 0 @fix(cache('NG_008939.1')) def test_ins_seq_list(self): @@ -597,8 +584,7 @@ class TestVariantchecker(MutalyzerTest): Insertion of a sequence as a list. """ check_variant('NG_008939.1:g.5207_5208ins[GTCCTGTGCTCATTATCTGGC]', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_008939.1:g.5207_5208insGTCCTGTGCTCATTATCTGGC') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_008939.1:g.5207_5208insGTCCTGTGCTCATTATCTGGC' assert 'NG_008939.1(PCCB_v001):c.156_157insGTCCTGTGCTCATTATCTGGC' \ in self.output.getOutput('descriptions') @@ -608,8 +594,7 @@ class TestVariantchecker(MutalyzerTest): Insertion of a sequence as a list on reverse strand. """ check_variant('NG_012337.1(TIMM8B_v001):c.12_13ins[GATC]', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_012337.1:g.4911_4912insATCG') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_012337.1:g.4911_4912insATCG' assert 'NG_012337.1(TIMM8B_v001):c.12_13insGATC' \ in self.output.getOutput('descriptions') @@ -619,11 +604,10 @@ class TestVariantchecker(MutalyzerTest): Insertion of a range as a list. """ check_variant('NG_008939.1:g.5207_5208ins[4300_4320]', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_008939.1:g.5207_5208insGTCCTGTGCTCATTATCTGGC') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_008939.1:g.5207_5208insGTCCTGTGCTCATTATCTGGC' assert 'NG_008939.1(PCCB_v001):c.156_157insGTCCTGTGCTCATTATCTGGC' \ in self.output.getOutput('descriptions') - assert_equal(len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')), 0) + assert len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')) == 0 @fix(cache('NG_008939.1')) def test_ins_range_inv_list(self): @@ -631,11 +615,10 @@ class TestVariantchecker(MutalyzerTest): Insertion of an inverse range as a list. """ check_variant('NG_008939.1:g.5207_5208ins[4300_4320inv]', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_008939.1:g.5207_5208insGCCAGATAATGAGCACAGGAC') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_008939.1:g.5207_5208insGCCAGATAATGAGCACAGGAC' assert 'NG_008939.1(PCCB_v001):c.156_157insGCCAGATAATGAGCACAGGAC' \ in self.output.getOutput('descriptions') - assert_equal(len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')), 0) + assert len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')) == 0 @fix(cache('NG_008939.1')) def test_ins_seq_seq(self): @@ -643,8 +626,7 @@ class TestVariantchecker(MutalyzerTest): Insertion of two sequences. """ check_variant('NG_008939.1:g.5207_5208ins[GTCCTGTGCTC;ATTATCTGGC]', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_008939.1:g.5207_5208insGTCCTGTGCTCATTATCTGGC') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_008939.1:g.5207_5208insGTCCTGTGCTCATTATCTGGC' assert 'NG_008939.1(PCCB_v001):c.156_157insGTCCTGTGCTCATTATCTGGC' \ in self.output.getOutput('descriptions') @@ -654,8 +636,7 @@ class TestVariantchecker(MutalyzerTest): Insertion of two sequences on reverse strand. """ check_variant('NG_012337.1(TIMM8B_v001):c.12_13ins[TTT;GATC]', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_012337.1:g.4911_4912insATCAAAG') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_012337.1:g.4911_4912insATCAAAG' assert 'NG_012337.1(TIMM8B_v001):c.12_13insTTTGATC' \ in self.output.getOutput('descriptions') @@ -665,11 +646,10 @@ class TestVariantchecker(MutalyzerTest): Insertion of two ranges. """ check_variant('NG_008939.1:g.5207_5208ins[4300_4309;4310_4320]', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_008939.1:g.5207_5208insGTCCTGTGCTCATTATCTGGC') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_008939.1:g.5207_5208insGTCCTGTGCTCATTATCTGGC' assert 'NG_008939.1(PCCB_v001):c.156_157insGTCCTGTGCTCATTATCTGGC' \ in self.output.getOutput('descriptions') - assert_equal(len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')), 0) + assert len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')) == 0 @fix(cache('NG_008939.1')) def test_ins_range_range_inv(self): @@ -677,11 +657,10 @@ class TestVariantchecker(MutalyzerTest): Insertion of a range and an inverse range. """ check_variant('NG_008939.1:g.5207_5208ins[4300_4309;4310_4320inv]', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_008939.1:g.5207_5208insGTCCTGTGCTGCCAGATAATG') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_008939.1:g.5207_5208insGTCCTGTGCTGCCAGATAATG' assert 'NG_008939.1(PCCB_v001):c.156_157insGTCCTGTGCTGCCAGATAATG' \ in self.output.getOutput('descriptions') - assert_equal(len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')), 0) + assert len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')) == 0 @fix(cache('NG_008939.1')) def test_ins_seq_range(self): @@ -689,8 +668,7 @@ class TestVariantchecker(MutalyzerTest): Insertion of a sequence and a range. """ check_variant('NG_008939.1:g.5207_5208ins[GTCCTGTGCT;4310_4320]', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_008939.1:g.5207_5208insGTCCTGTGCTCATTATCTGGC') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_008939.1:g.5207_5208insGTCCTGTGCTCATTATCTGGC' assert 'NG_008939.1(PCCB_v001):c.156_157insGTCCTGTGCTCATTATCTGGC' \ in self.output.getOutput('descriptions') @@ -700,8 +678,7 @@ class TestVariantchecker(MutalyzerTest): Insertion of a sequence and an inverse range. """ check_variant('NG_008939.1:g.5207_5208ins[GTCCTGTGCT;4310_4320inv]', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_008939.1:g.5207_5208insGTCCTGTGCTGCCAGATAATG') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_008939.1:g.5207_5208insGTCCTGTGCTGCCAGATAATG' assert 'NG_008939.1(PCCB_v001):c.156_157insGTCCTGTGCTGCCAGATAATG' \ in self.output.getOutput('descriptions') @@ -711,8 +688,7 @@ class TestVariantchecker(MutalyzerTest): Insertion of a range and a sequence. """ check_variant('NG_008939.1:g.5207_5208ins[4300_4309;CATTATCTGGC]', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_008939.1:g.5207_5208insGTCCTGTGCTCATTATCTGGC') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_008939.1:g.5207_5208insGTCCTGTGCTCATTATCTGGC' assert 'NG_008939.1(PCCB_v001):c.156_157insGTCCTGTGCTCATTATCTGGC' \ in self.output.getOutput('descriptions') @@ -722,8 +698,7 @@ class TestVariantchecker(MutalyzerTest): Insertion of an inverse range and a sequence. """ check_variant('NG_008939.1:g.5207_5208ins[4300_4309inv;CATTATCTGGC]', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_008939.1:g.5207_5208insAGCACAGGACCATTATCTGGC') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_008939.1:g.5207_5208insAGCACAGGACCATTATCTGGC' assert 'NG_008939.1(PCCB_v001):c.156_157insAGCACAGGACCATTATCTGGC' \ in self.output.getOutput('descriptions') @@ -733,8 +708,7 @@ class TestVariantchecker(MutalyzerTest): Insertion of a sequence (coding). """ check_variant('NG_008939.1(PCCB_v001):c.156_157insGTCCTGTGCTCATTATCTGGC', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_008939.1:g.5207_5208insGTCCTGTGCTCATTATCTGGC') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_008939.1:g.5207_5208insGTCCTGTGCTCATTATCTGGC' assert 'NG_008939.1(PCCB_v001):c.156_157insGTCCTGTGCTCATTATCTGGC' \ in self.output.getOutput('descriptions') @@ -744,8 +718,7 @@ class TestVariantchecker(MutalyzerTest): Insertion of a sequence as a list (coding). """ check_variant('NG_008939.1(PCCB_v001):c.156_157ins[GTCCTGTGCTCATTATCTGGC]', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_008939.1:g.5207_5208insGTCCTGTGCTCATTATCTGGC') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_008939.1:g.5207_5208insGTCCTGTGCTCATTATCTGGC' assert 'NG_008939.1(PCCB_v001):c.156_157insGTCCTGTGCTCATTATCTGGC' \ in self.output.getOutput('descriptions') @@ -755,8 +728,7 @@ class TestVariantchecker(MutalyzerTest): Insertion of two sequences (coding). """ check_variant('NG_008939.1(PCCB_v001):c.156_157ins[GTCCTGTGCTC;ATTATCTGGC]', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_008939.1:g.5207_5208insGTCCTGTGCTCATTATCTGGC') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_008939.1:g.5207_5208insGTCCTGTGCTCATTATCTGGC' assert 'NG_008939.1(PCCB_v001):c.156_157insGTCCTGTGCTCATTATCTGGC' \ in self.output.getOutput('descriptions') @@ -766,7 +738,7 @@ class TestVariantchecker(MutalyzerTest): Insertion of a range (coding). """ check_variant('NG_008939.1(PCCB_v001):c.156_157ins180_188', self.output) - assert_equal(len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')), 1) + assert len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')) == 1 @fix(cache('NG_008939.1')) def test_ins_range_inv_coding(self): @@ -774,7 +746,7 @@ class TestVariantchecker(MutalyzerTest): Insertion of an inverse range (coding). """ check_variant('NG_008939.1(PCCB_v001):c.156_157ins180_188inv', self.output) - assert_equal(len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')), 1) + assert len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')) == 1 @fix(cache('NG_008939.1')) def test_ins_range_list_coding(self): @@ -782,7 +754,7 @@ class TestVariantchecker(MutalyzerTest): Insertion of a range as a list (coding). """ check_variant('NG_008939.1(PCCB_v001):c.156_157ins[180_188]', self.output) - assert_equal(len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')), 1) + assert len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')) == 1 @fix(cache('NG_008939.1')) def test_ins_range_inv_list_coding(self): @@ -790,7 +762,7 @@ class TestVariantchecker(MutalyzerTest): Insertion of an inverse range as a list (coding). """ check_variant('NG_008939.1(PCCB_v001):c.156_157ins[180_188inv]', self.output) - assert_equal(len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')), 1) + assert len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')) == 1 @fix(cache('NG_008939.1')) def test_delins_seq(self): @@ -798,8 +770,7 @@ class TestVariantchecker(MutalyzerTest): Insertion-deletion of a sequence. """ check_variant('NG_008939.1:g.5207_5212delinsGTCCTGTGCTCATTATCTGGC', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_008939.1:g.5207_5212delinsGTCCTGTGCTCATTATCTGGC') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_008939.1:g.5207_5212delinsGTCCTGTGCTCATTATCTGGC' assert 'NG_008939.1(PCCB_v001):c.156_161delinsGTCCTGTGCTCATTATCTGGC' \ in self.output.getOutput('descriptions') @@ -809,11 +780,10 @@ class TestVariantchecker(MutalyzerTest): Insertion-deletion of a range. """ check_variant('NG_008939.1:g.5207_5212delins4300_4320', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_008939.1:g.5207_5212delinsGTCCTGTGCTCATTATCTGGC') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_008939.1:g.5207_5212delinsGTCCTGTGCTCATTATCTGGC' assert 'NG_008939.1(PCCB_v001):c.156_161delinsGTCCTGTGCTCATTATCTGGC' \ in self.output.getOutput('descriptions') - assert_equal(len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')), 0) + assert len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')) == 0 @fix(cache('NG_008939.1')) def test_delins_range_inv(self): @@ -821,11 +791,10 @@ class TestVariantchecker(MutalyzerTest): Insertion-deletion of an inverse range. """ check_variant('NG_008939.1:g.5207_5212delins4300_4320inv', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_008939.1:g.5207_5212delinsGCCAGATAATGAGCACAGGAC') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_008939.1:g.5207_5212delinsGCCAGATAATGAGCACAGGAC' assert 'NG_008939.1(PCCB_v001):c.156_161delinsGCCAGATAATGAGCACAGGAC' \ in self.output.getOutput('descriptions') - assert_equal(len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')), 0) + assert len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')) == 0 @fix(cache('NG_008939.1')) def test_delins_seq_list(self): @@ -833,8 +802,7 @@ class TestVariantchecker(MutalyzerTest): Insertion-deletion of a sequence as a list. """ check_variant('NG_008939.1:g.5207_5212delins[GTCCTGTGCTCATTATCTGGC]', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_008939.1:g.5207_5212delinsGTCCTGTGCTCATTATCTGGC') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_008939.1:g.5207_5212delinsGTCCTGTGCTCATTATCTGGC' assert 'NG_008939.1(PCCB_v001):c.156_161delinsGTCCTGTGCTCATTATCTGGC' \ in self.output.getOutput('descriptions') @@ -844,11 +812,10 @@ class TestVariantchecker(MutalyzerTest): Insertion-deletion of a range as a list. """ check_variant('NG_008939.1:g.5207_5212delins[4300_4320]', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_008939.1:g.5207_5212delinsGTCCTGTGCTCATTATCTGGC') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_008939.1:g.5207_5212delinsGTCCTGTGCTCATTATCTGGC' assert 'NG_008939.1(PCCB_v001):c.156_161delinsGTCCTGTGCTCATTATCTGGC' \ in self.output.getOutput('descriptions') - assert_equal(len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')), 0) + assert len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')) == 0 @fix(cache('NG_008939.1')) def test_delins_range_inv_list(self): @@ -856,11 +823,10 @@ class TestVariantchecker(MutalyzerTest): Insertion-deletion of an inverse range as a list. """ check_variant('NG_008939.1:g.5207_5212delins[4300_4320inv]', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_008939.1:g.5207_5212delinsGCCAGATAATGAGCACAGGAC') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_008939.1:g.5207_5212delinsGCCAGATAATGAGCACAGGAC' assert 'NG_008939.1(PCCB_v001):c.156_161delinsGCCAGATAATGAGCACAGGAC' \ in self.output.getOutput('descriptions') - assert_equal(len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')), 0) + assert len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')) == 0 @fix(cache('NG_008939.1')) def test_delins_seq_seq(self): @@ -868,8 +834,7 @@ class TestVariantchecker(MutalyzerTest): Insertion-deletion of two sequences. """ check_variant('NG_008939.1:g.5207_5212delins[GTCCTGTGCT;CATTATCTGGC]', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_008939.1:g.5207_5212delinsGTCCTGTGCTCATTATCTGGC') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_008939.1:g.5207_5212delinsGTCCTGTGCTCATTATCTGGC' assert 'NG_008939.1(PCCB_v001):c.156_161delinsGTCCTGTGCTCATTATCTGGC' \ in self.output.getOutput('descriptions') @@ -879,11 +844,10 @@ class TestVariantchecker(MutalyzerTest): Insertion-deletion of two ranges. """ check_variant('NG_008939.1:g.5207_5212delins[4300_4309;4310_4320]', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_008939.1:g.5207_5212delinsGTCCTGTGCTCATTATCTGGC') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_008939.1:g.5207_5212delinsGTCCTGTGCTCATTATCTGGC' assert 'NG_008939.1(PCCB_v001):c.156_161delinsGTCCTGTGCTCATTATCTGGC' \ in self.output.getOutput('descriptions') - assert_equal(len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')), 0) + assert len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')) == 0 @fix(cache('NG_008939.1')) def test_delins_range_inv_range(self): @@ -893,11 +857,10 @@ class TestVariantchecker(MutalyzerTest): Note that the delins is also shortened by one position here. """ check_variant('NG_008939.1:g.5207_5212delins[4300_4309inv;4310_4320]', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_008939.1:g.5208_5212delinsGCACAGGACCATTATCTGGC') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_008939.1:g.5208_5212delinsGCACAGGACCATTATCTGGC' assert 'NG_008939.1(PCCB_v001):c.157_161delinsGCACAGGACCATTATCTGGC' \ in self.output.getOutput('descriptions') - assert_equal(len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')), 0) + assert len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')) == 0 @fix(cache('NG_008939.1')) def test_delins_seq_range(self): @@ -905,8 +868,7 @@ class TestVariantchecker(MutalyzerTest): Insertion-deletion of a sequence and a range. """ check_variant('NG_008939.1:g.5207_5212delins[GTCCTGTGCT;4310_4320]', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_008939.1:g.5207_5212delinsGTCCTGTGCTCATTATCTGGC') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_008939.1:g.5207_5212delinsGTCCTGTGCTCATTATCTGGC' assert 'NG_008939.1(PCCB_v001):c.156_161delinsGTCCTGTGCTCATTATCTGGC' \ in self.output.getOutput('descriptions') @@ -918,8 +880,7 @@ class TestVariantchecker(MutalyzerTest): Note that the delins is also shortened by one position here. """ check_variant('NG_008939.1:g.5207_5212delins[GTCCTGTGCT;4310_4320inv]', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_008939.1:g.5207_5211delinsGTCCTGTGCTGCCAGATAAT') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_008939.1:g.5207_5211delinsGTCCTGTGCTGCCAGATAAT' assert 'NG_008939.1(PCCB_v001):c.156_160delinsGTCCTGTGCTGCCAGATAAT' \ in self.output.getOutput('descriptions') @@ -929,8 +890,7 @@ class TestVariantchecker(MutalyzerTest): Insertion-deletion of a range and a sequence. """ check_variant('NG_008939.1:g.5207_5212delins[4300_4309;CATTATCTGGC]', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_008939.1:g.5207_5212delinsGTCCTGTGCTCATTATCTGGC') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_008939.1:g.5207_5212delinsGTCCTGTGCTCATTATCTGGC' assert 'NG_008939.1(PCCB_v001):c.156_161delinsGTCCTGTGCTCATTATCTGGC' \ in self.output.getOutput('descriptions') @@ -942,8 +902,7 @@ class TestVariantchecker(MutalyzerTest): Note that the delins is also shortened by one position here. """ check_variant('NG_008939.1:g.5207_5212delins[4300_4309inv;CATTATCTGGC]', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_008939.1:g.5208_5212delinsGCACAGGACCATTATCTGGC') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_008939.1:g.5208_5212delinsGCACAGGACCATTATCTGGC' assert 'NG_008939.1(PCCB_v001):c.157_161delinsGCACAGGACCATTATCTGGC' \ in self.output.getOutput('descriptions') @@ -953,8 +912,7 @@ class TestVariantchecker(MutalyzerTest): Insertion-deletion of a sequence (coding). """ check_variant('NG_008939.1(PCCB_v001):c.156_161delinsGTCCTGTGCTCATTATCTGGC', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_008939.1:g.5207_5212delinsGTCCTGTGCTCATTATCTGGC') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_008939.1:g.5207_5212delinsGTCCTGTGCTCATTATCTGGC' assert 'NG_008939.1(PCCB_v001):c.156_161delinsGTCCTGTGCTCATTATCTGGC' \ in self.output.getOutput('descriptions') @@ -964,8 +922,7 @@ class TestVariantchecker(MutalyzerTest): Insertion-deletion of a sequence as a list (coding). """ check_variant('NG_008939.1(PCCB_v001):c.156_161delins[GTCCTGTGCTCATTATCTGGC]', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_008939.1:g.5207_5212delinsGTCCTGTGCTCATTATCTGGC') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_008939.1:g.5207_5212delinsGTCCTGTGCTCATTATCTGGC' assert 'NG_008939.1(PCCB_v001):c.156_161delinsGTCCTGTGCTCATTATCTGGC' \ in self.output.getOutput('descriptions') @@ -975,8 +932,7 @@ class TestVariantchecker(MutalyzerTest): Insertion-deletion of two sequences (coding). """ check_variant('NG_008939.1(PCCB_v001):c.156_161delins[GTCCTGTGCT;CATTATCTGGC]', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_008939.1:g.5207_5212delinsGTCCTGTGCTCATTATCTGGC') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_008939.1:g.5207_5212delinsGTCCTGTGCTCATTATCTGGC' assert 'NG_008939.1(PCCB_v001):c.156_161delinsGTCCTGTGCTCATTATCTGGC' \ in self.output.getOutput('descriptions') @@ -986,7 +942,7 @@ class TestVariantchecker(MutalyzerTest): Insertion-deletion of a range (coding). """ check_variant('NG_008939.1(PCCB_v001):c.156_161delins180_188', self.output) - assert_equal(len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')), 1) + assert len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')) == 1 @fix(cache('NG_008939.1')) def test_delins_range_inv_coding(self): @@ -994,7 +950,7 @@ class TestVariantchecker(MutalyzerTest): Insertion-deletion of an inverse range (coding). """ check_variant('NG_008939.1(PCCB_v001):c.156_161delins180_188inv', self.output) - assert_equal(len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')), 1) + assert len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')) == 1 @fix(cache('NG_008939.1')) def test_delins_range_list_coding(self): @@ -1002,7 +958,7 @@ class TestVariantchecker(MutalyzerTest): Insertion-deletion of a range as a list (coding). """ check_variant('NG_008939.1(PCCB_v001):c.156_161delins[180_188]', self.output) - assert_equal(len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')), 1) + assert len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')) == 1 @fix(cache('NG_008939.1')) def test_delins_range_inv_list_coding(self): @@ -1010,14 +966,14 @@ class TestVariantchecker(MutalyzerTest): Insertion-deletion of an inverse range as a list (coding). """ check_variant('NG_008939.1(PCCB_v001):c.156_161delins[180_188inv]', self.output) - assert_equal(len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')), 1) + assert len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')) == 1 def test_no_reference(self): """ Variant description without a reference. """ check_variant('g.244355733del', self.output) - assert_equal(len(self.output.getMessagesWithErrorCode('ENOREF')), 1) + assert len(self.output.getMessagesWithErrorCode('ENOREF')) == 1 @fix(cache('NM_003002.2'), hg19, hg19_transcript_mappings) def test_chromosomal_positions(self): @@ -1026,8 +982,7 @@ class TestVariantchecker(MutalyzerTest): defined. """ check_variant('NM_003002.2:c.274G>T', self.output) - assert_equal(self.output.getIndexedOutput('rawVariantsChromosomal', 0), - ('chr11', '+', [('274G>T', (111959695, 111959695))])) + assert self.output.getIndexedOutput('rawVariantsChromosomal', 0) == ('chr11', '+', [('274G>T', (111959695, 111959695))]) @fix(cache('NM_002001.2')) def test_ex_notation(self): @@ -1036,7 +991,7 @@ class TestVariantchecker(MutalyzerTest): one exon should delete two splice sites. """ check_variant('NM_002001.2:c.EX1del', self.output) - assert_equal(len(self.output.getMessagesWithErrorCode('IDELSPLICE')), 1) + assert len(self.output.getMessagesWithErrorCode('IDELSPLICE')) == 1 @fix(cache('LRG_1')) def test_lrg_reference(self): @@ -1045,9 +1000,8 @@ class TestVariantchecker(MutalyzerTest): """ check_variant('LRG_1t1:c.266G>T', self.output) error_count, _, _ = self.output.Summary() - assert_equal(error_count, 0) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'LRG_1:g.6855G>T') + assert error_count == 0 + assert self.output.getIndexedOutput('genomicDescription', 0) == 'LRG_1:g.6855G>T' @fix(cache('NM_002001.2')) def test_gi_reference_plain(self): @@ -1056,9 +1010,8 @@ class TestVariantchecker(MutalyzerTest): """ check_variant('31317229:c.6del', self.output) error_count, _, _ = self.output.Summary() - assert_equal(error_count, 0) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - '31317229:n.105del') + assert error_count == 0 + assert self.output.getIndexedOutput('genomicDescription', 0) == '31317229:n.105del' assert '31317229(FCER1A_v001):c.6del' \ in self.output.getOutput('descriptions') @@ -1069,9 +1022,8 @@ class TestVariantchecker(MutalyzerTest): """ check_variant('GI31317229:c.6del', self.output) error_count, _, _ = self.output.Summary() - assert_equal(error_count, 0) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - '31317229:n.105del') + assert error_count == 0 + assert self.output.getIndexedOutput('genomicDescription', 0) == '31317229:n.105del' assert '31317229(FCER1A_v001):c.6del' \ in self.output.getOutput('descriptions') @@ -1082,9 +1034,8 @@ class TestVariantchecker(MutalyzerTest): """ check_variant('GI:31317229:c.6del', self.output) error_count, _, _ = self.output.Summary() - assert_equal(error_count, 0) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - '31317229:n.105del') + assert error_count == 0 + assert self.output.getIndexedOutput('genomicDescription', 0) == '31317229:n.105del' assert '31317229(FCER1A_v001):c.6del' \ in self.output.getOutput('descriptions') @@ -1095,9 +1046,8 @@ class TestVariantchecker(MutalyzerTest): """ check_variant('NM_002001.2:c.1_3delinsATG', self.output) error_count, _, _ = self.output.Summary() - assert_equal(error_count, 0) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NM_002001.2:n.=') + assert error_count == 0 + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NM_002001.2:n.=' assert 'NM_002001.2(FCER1A_v001):c.=' \ in self.output.getOutput('descriptions') @@ -1109,11 +1059,9 @@ class TestVariantchecker(MutalyzerTest): ud = REFERENCES['DMD']['accession'] check_variant(ud + ':g.5T>T', self.output) error_count, _, _ = self.output.Summary() - assert_equal(error_count, 0) - assert_equal(self.output.getIndexedOutput('genomicChromDescription', 0), - 'NC_000023.10:g.=') - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - ud + ':g.=') + assert error_count == 0 + assert self.output.getIndexedOutput('genomicChromDescription', 0) == 'NC_000023.10:g.=' + assert self.output.getIndexedOutput('genomicDescription', 0) == ud + ':g.=' assert ud + '(DMD_v001):c.=' \ in self.output.getOutput('descriptions') @@ -1126,11 +1074,9 @@ class TestVariantchecker(MutalyzerTest): ud = REFERENCES['DPYD']['accession'] check_variant(ud + '(DPYD_v1):c.85C>T', self.output) error_count, _, _ = self.output.Summary() - assert_equal(error_count, 0) - assert_equal(self.output.getIndexedOutput('genomicChromDescription', 0), - 'NC_000001.10:g.98348885G>A') - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - ud + ':g.42731C>T') + assert error_count == 0 + assert self.output.getIndexedOutput('genomicChromDescription', 0) == 'NC_000001.10:g.98348885G>A' + assert self.output.getIndexedOutput('genomicDescription', 0) == ud + ':g.42731C>T' assert ud + '(DPYD_v001):c.85C>T' \ in self.output.getOutput('descriptions') @@ -1142,11 +1088,9 @@ class TestVariantchecker(MutalyzerTest): ud = REFERENCES['MARK1']['accession'] check_variant(ud + '(MARK1_v001):c.400T>C', self.output) error_count, _, _ = self.output.Summary() - assert_equal(error_count, 0) - assert_equal(self.output.getIndexedOutput('genomicChromDescription', 0), - 'NC_000001.10:g.220773181T>C') - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - ud + ':g.76614T>C') + assert error_count == 0 + assert self.output.getIndexedOutput('genomicChromDescription', 0) == 'NC_000001.10:g.220773181T>C' + assert self.output.getIndexedOutput('genomicDescription', 0) == ud + ':g.76614T>C' assert ud + '(MARK1_v001):c.400T>C' \ in self.output.getOutput('descriptions') @@ -1160,11 +1104,9 @@ class TestVariantchecker(MutalyzerTest): ud = REFERENCES['chr9_reverse']['accession'] check_variant(ud + ':g.10624_78132del', self.output) error_count, _, _ = self.output.Summary() - assert_equal(error_count, 0) - assert_equal(self.output.getIndexedOutput('genomicChromDescription', 0), - 'NC_000009.11:g.32928508_32996016del') - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - ud + ':g.10624_78132del') + assert error_count == 0 + assert self.output.getIndexedOutput('genomicChromDescription', 0) == 'NC_000009.11:g.32928508_32996016del' + assert self.output.getIndexedOutput('genomicDescription', 0) == ud + ':g.10624_78132del' @fix(cache('MARK1')) def test_ud_forward_range(self): @@ -1174,11 +1116,9 @@ class TestVariantchecker(MutalyzerTest): ud = REFERENCES['MARK1']['accession'] check_variant(ud + '(MARK1_v001):c.400_415del', self.output) error_count, _, _ = self.output.Summary() - assert_equal(error_count, 0) - assert_equal(self.output.getIndexedOutput('genomicChromDescription', 0), - 'NC_000001.10:g.220773181_220773196del') - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - ud + ':g.76614_76629del') + assert error_count == 0 + assert self.output.getIndexedOutput('genomicChromDescription', 0) == 'NC_000001.10:g.220773181_220773196del' + assert self.output.getIndexedOutput('genomicDescription', 0) == ud + ':g.76614_76629del' @fix(cache('chr9_reverse')) def test_ud_reverse_del_length(self): @@ -1191,11 +1131,9 @@ class TestVariantchecker(MutalyzerTest): ud = REFERENCES['chr9_reverse']['accession'] check_variant(ud + ':g.10624_78132del67509', self.output) error_count, _, _ = self.output.Summary() - assert_equal(error_count, 0) - assert_equal(self.output.getIndexedOutput('genomicChromDescription', 0), - 'NC_000009.11:g.32928508_32996016del') - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - ud + ':g.10624_78132del') + assert error_count == 0 + assert self.output.getIndexedOutput('genomicChromDescription', 0) == 'NC_000009.11:g.32928508_32996016del' + assert self.output.getIndexedOutput('genomicDescription', 0) == ud + ':g.10624_78132del' @fix(cache('DPYD')) def test_ud_reverse_roll(self): @@ -1212,11 +1150,9 @@ class TestVariantchecker(MutalyzerTest): ud = REFERENCES['DPYD']['accession'] check_variant(ud + '(DPYD_v001):c.104del', self.output) error_count, _, _ = self.output.Summary() - assert_equal(error_count, 0) - assert_equal(self.output.getIndexedOutput('genomicChromDescription', 0), - 'NC_000001.10:g.98348867del') - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - ud + ':g.42751del') + assert error_count == 0 + assert self.output.getIndexedOutput('genomicChromDescription', 0) == 'NC_000001.10:g.98348867del' + assert self.output.getIndexedOutput('genomicDescription', 0) == ud + ':g.42751del' assert ud + '(DPYD_v001):c.105del' \ in self.output.getOutput('descriptions') @@ -1235,11 +1171,9 @@ class TestVariantchecker(MutalyzerTest): ud = REFERENCES['MARK1']['accession'] check_variant(ud + '(MARK1_v001):c.400del', self.output) error_count, _, _ = self.output.Summary() - assert_equal(error_count, 0) - assert_equal(self.output.getIndexedOutput('genomicChromDescription', 0), - 'NC_000001.10:g.220773182del') - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - ud + ':g.76615del') + assert error_count == 0 + assert self.output.getIndexedOutput('genomicChromDescription', 0) == 'NC_000001.10:g.220773182del' + assert self.output.getIndexedOutput('genomicDescription', 0) == ud + ':g.76615del' assert ud + '(MARK1_v001):c.401del' \ in self.output.getOutput('descriptions') @@ -1249,8 +1183,7 @@ class TestVariantchecker(MutalyzerTest): Specify the deleted sequence in a deletion. """ check_variant('AL449423.14:g.65471_65472delTC', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'AL449423.14:g.65471_65472del') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'AL449423.14:g.65471_65472del' assert 'AL449423.14(CDKN2A_v001):c.98_99del' \ in self.output.getOutput('descriptions') @@ -1260,8 +1193,7 @@ class TestVariantchecker(MutalyzerTest): Specify the deleted sequence length in a deletion. """ check_variant('AL449423.14:g.65471_65472del2', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'AL449423.14:g.65471_65472del') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'AL449423.14:g.65471_65472del' assert 'AL449423.14(CDKN2A_v001):c.98_99del' \ in self.output.getOutput('descriptions') @@ -1271,8 +1203,7 @@ class TestVariantchecker(MutalyzerTest): Specify the deleted sequence in a deletion on the reverse strand. """ check_variant('AL449423.14(CDKN2A_v001):c.161_163delTGG', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'AL449423.14:g.61937_61939del') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'AL449423.14:g.61937_61939del' assert 'AL449423.14(CDKN2A_v001):c.161_163del' \ in self.output.getOutput('descriptions') @@ -1282,8 +1213,7 @@ class TestVariantchecker(MutalyzerTest): Specify the deleted sequence length in a deletion on the reverse strand. """ check_variant('AL449423.14(CDKN2A_v001):c.161_163del3', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'AL449423.14:g.61937_61939del') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'AL449423.14:g.61937_61939del' assert 'AL449423.14(CDKN2A_v001):c.161_163del' \ in self.output.getOutput('descriptions') @@ -1294,8 +1224,7 @@ class TestVariantchecker(MutalyzerTest): using a genomic reference. """ check_variant('NG_008939.1:c.155_157delAAC', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_008939.1:g.5206_5208del') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_008939.1:g.5206_5208del' assert 'NG_008939.1(PCCB_v001):c.155_157del' \ in self.output.getOutput('descriptions') @@ -1306,8 +1235,7 @@ class TestVariantchecker(MutalyzerTest): using a genomic reference. """ check_variant('NG_008939.1:c.155_157del3', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'NG_008939.1:g.5206_5208del') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'NG_008939.1:g.5206_5208del' assert 'NG_008939.1(PCCB_v001):c.155_157del' \ in self.output.getOutput('descriptions') @@ -1317,8 +1245,7 @@ class TestVariantchecker(MutalyzerTest): Inversion variant. """ check_variant('AB026906.1:c.274_275inv', self.output) - assert_equal(self.output.getIndexedOutput('genomicDescription', 0), - 'AB026906.1:g.7872_7873inv') + assert self.output.getIndexedOutput('genomicDescription', 0) == 'AB026906.1:g.7872_7873inv' assert 'AB026906.1(SDHD_v001):c.274_275inv' \ in self.output.getOutput('descriptions') @@ -1336,7 +1263,7 @@ class TestVariantchecker(MutalyzerTest): Currently protein level descriptions are not implemented. """ check_variant('NG_009105.1(OPN1LW):p.=', self.output) - assert_equal(len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')), 1) + assert len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')) == 1 @fix(cache('NP_064445.1')) def test_protein_reference(self): @@ -1344,7 +1271,7 @@ class TestVariantchecker(MutalyzerTest): Currently protein references are not implemented. """ check_variant('NP_064445.1:p.=', self.output) - assert_equal(len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')), 1) + assert len(self.output.getMessagesWithErrorCode('ENOTIMPLEMENTED')) == 1 @fix(cache('A1BG')) def test_wnomrna_other(self): diff --git a/tests/test_website.py b/tests/test_website.py index 04562466..6b1e75d0 100644 --- a/tests/test_website.py +++ b/tests/test_website.py @@ -19,7 +19,6 @@ import urllib2 from Bio import Entrez import lxml.html -from nose.tools import * import mutalyzer from mutalyzer import Scheduler @@ -46,7 +45,7 @@ class TestWebsite(MutalyzerTest): Expect the index HTML page. """ r = self.app.get('/') - assert_equal(r.status_code, 200) + assert r.status_code == 200 assert 'Welcome to the Mutalyzer website' in r.data def test_about(self): @@ -54,7 +53,7 @@ class TestWebsite(MutalyzerTest): See if people get proper credit. """ r = self.app.get('/about') - assert_equal(r.status, '200 OK') + assert r.status == '200 OK' assert 'Jonathan Vis' in r.data def test_non_existing(self): @@ -62,7 +61,7 @@ class TestWebsite(MutalyzerTest): Expect a 404 response. """ r = self.app.get('/this/doesnotexist') - assert_equal(r.status_code, 404) + assert r.status_code == 404 @fix(database) def test_menu_links(self): @@ -84,7 +83,7 @@ class TestWebsite(MutalyzerTest): href = '/' + href r = self.app.get(href) - assert_equal(r.status_code, 200) + assert r.status_code == 200 def test_description_extractor(self): """ @@ -275,7 +274,7 @@ class TestWebsite(MutalyzerTest): r = self.app.get(result_url) assert 'text/plain' in r.headers['Content-Type'] assert header in r.data - assert_equal(len(r.data.strip().split('\n')) - 1, lines) + assert len(r.data.strip().split('\n')) - 1 == lines return r.data @@ -469,7 +468,7 @@ class TestWebsite(MutalyzerTest): header='Input\tStatus', lines=len(variants)) for line in result.splitlines()[1:]: - assert_equal(len(line.split('\t')), len(variants[0]) * 2) + assert len(line.split('\t')) == len(variants[0]) * 2 def test_download_py(self): """ @@ -492,7 +491,7 @@ class TestWebsite(MutalyzerTest): Download a C# example client for the web service. """ r = self.app.get('/downloads/client-mono.cs') - assert_equal(r.headers['Content-Type'], 'text/plain') + assert r.headers['Content-Type'] == 'text/plain' assert 'public static void Main(String [] args) {' in r.data def test_download_php(self): @@ -547,7 +546,7 @@ class TestWebsite(MutalyzerTest): 'var': 'g.48374289_48374389del'}) assert 'text/plain' in r.headers['Content-Type'] expected = '\n'.join(['1020', '0', '1072', '48', '48374289', '48374389', 'del']) - assert_equal(r.data, expected) + assert r.data == expected @fix(database, hg19, hg19_transcript_mappings) def test_variantinfo_c2g(self): @@ -561,7 +560,7 @@ class TestWebsite(MutalyzerTest): 'var': 'c.1020_1072+48del'}) assert 'text/plain' in r.headers['Content-Type'] expected = '\n'.join(['1020', '0', '1072', '48', '48374289', '48374389', 'del']) - assert_equal(r.data, expected) + assert r.data == expected @fix(database, hg19, hg19_transcript_mappings) def test_variantinfo_c2g_downstream(self): @@ -576,7 +575,7 @@ class TestWebsite(MutalyzerTest): 'var': 'c.1709+d187del'}) assert 'text/plain' in r.headers['Content-Type'] expected = '\n'.join(['1709', '187', '1709', '187', '48379389', '48379389', 'del']) - assert_equal(r.data, expected) + assert r.data == expected @fix(database, hg19, hg19_transcript_mappings) def test_variantinfo_no_variant(self): @@ -588,9 +587,9 @@ class TestWebsite(MutalyzerTest): 'build': 'hg19', 'acc': 'NM_203473.1'}) assert 'text/plain' in r.headers['Content-Type'] - assert_equal(r.content_type, 'text/plain') + assert r.content_type == 'text/plain' expected = '\n'.join(['-158', '1709', '1371']) - assert_equal(r.data, expected) + assert r.data == expected @fix(database, hg19, hg19_transcript_mappings) def test_variantinfo_ivs(self): @@ -604,7 +603,7 @@ class TestWebsite(MutalyzerTest): 'var': 'c.IVS10+3A>G'}) assert 'text/plain' in r.headers['Content-Type'] expected = '\n'.join(['884', '3', '884', '3', '37059093', '37059093', 'subst']) - assert_equal(r.data, expected) + assert r.data == expected @fix(database) def test_upload_local_file(self): @@ -623,7 +622,7 @@ class TestWebsite(MutalyzerTest): reference_url = dom.cssselect('#reference_download')[0].attrib['href'] r = self.app.get(reference_url) - assert_equal(r.data, bz2.BZ2File(path).read()) + assert r.data == bz2.BZ2File(path).read() @fix(database) def test_upload_local_file_invalid(self): @@ -649,7 +648,7 @@ class TestWebsite(MutalyzerTest): path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'data', 'NM_002001.2.gb.bz2') - assert_equal(r.data, bz2.BZ2File(path).read()) + assert r.data == bz2.BZ2File(path).read() @fix(database, cache('NM_002001.2')) def test_reference_head(self): @@ -661,7 +660,7 @@ class TestWebsite(MutalyzerTest): assert '0 Errors' in r.data r = self.app.head('/reference/NM_002001.2.gb') - assert_equal(r.status_code, 200) + assert r.status_code == 200 @fix(database) def test_reference_head_none(self): @@ -669,7 +668,7 @@ class TestWebsite(MutalyzerTest): Test if non-existing reference files gives a 404 on a HEAD request. """ r = self.app.head('/reference/NM_002001.2.gb') - assert_equal(r.status_code, 404) + assert r.status_code == 404 @fix(database, hg19, hg19_transcript_mappings, cache('NM_003002.2')) def test_bed(self): -- GitLab