From 97fc25959d52c2abfe2f40b6457f55528f0dbf43 Mon Sep 17 00:00:00 2001 From: Gabriel Studer <gabriel.studer@stud.unibas.ch> Date: Fri, 26 Oct 2012 10:31:32 +0200 Subject: [PATCH] Make it run under older python versions. Additionally, one unit test had to be modified, since old blast versions (e.g. 2.2.16) find 27 hits in the created testdatabase and new blastversions (e.g. 2.2.27+) find 28 hits. The only check now is, wether the created database works/something can be found in it. --- modules/bindings/tests/test_blast.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/bindings/tests/test_blast.py b/modules/bindings/tests/test_blast.py index 25de6cf08..54a5c4ef8 100644 --- a/modules/bindings/tests/test_blast.py +++ b/modules/bindings/tests/test_blast.py @@ -72,7 +72,7 @@ class TestBlastBindings(unittest.TestCase): self.assertRaises(RuntimeError, blast.Blast, self.query, 'testfiles/seqdb', blast_location='/I/do/not/exist') version=blast.BlastVersion() - self.assertIsInstance(version,str) + self.assertTrue(isinstance(version,str)) re_v = re.compile('\d+\.\d+\.\d+') match=False if re_v.match(version): @@ -90,7 +90,7 @@ class TestBlastBindings(unittest.TestCase): test_seq=seq.CreateSequence('B','ALRLVKDGFAVAIADYNDATATAVAAEINQAGGRAVAIKVDV'+ 'SRRDQVFAAVEQARKALGGFNVIVNNAGIAPSTPIESIT') blastout=blast.Blast(test_seq,db_name) - self.assertEqual(len(blastout),28) + self.assertTrue(len(blastout)>10) shutil.rmtree(tmp_dir_name) if __name__ == "__main__": -- GitLab