Description: Since ncbi-tools6 6.1.20160908-1 some blast relatet tests
 are failing at package Build time.  These tests are deleted here.
 .
 Without the patches in tests/test_app/test_blast.py the build hangs totally
 and needs to be interrupted by ^C.
 .
 The patches in tests/test_app/test_formatdb.py lead to regular test suite
 failures with proper output of the problem.
Bug-Debian: https://bugs.debian.org/847082
Author: Andreas Tille <tille@debian.org>
Last-Update: Mon, 05 Dec 2016 13:23:40 +0100

--- a/tests/test_app/test_blast.py
+++ b/tests/test_app/test_blast.py
@@ -174,71 +174,6 @@ MSGNIKKIVEPNSGIDYSLEKDFKIFTLSKELPITTYPSY
         self.assertEqualItems(k, \
             ['ece:Z4181','ecs:ECs3717','spt:SPA2730','cvi:CV2421','ece:Z4182'])
 
-    def test_ids_from_seq_lower_threshold(self):
-        "ids_from_seq_lower_threshold returns psiblast hits, decreasing sens"
-        bdb_seqs = self.fasta_recs
-        f = open('test_bdb', 'w')
-        f.write(bdb_seqs)
-        f.close()
-        temp = popen('formatdb -i test_bdb -o T -p T')
-        params = {'-j':2,
-                '-d':'test_bdb'}
-        query = self.query_1.split('\n')
-        app = PsiBlast(params=params, 
-                InputHandler='_input_as_lines')
-        #the command below should result in finding itself and 2554
-        #it should run for max_iterations
-        result = ids_from_seq_lower_threshold(query, n=12, \
-                max_iterations=4, app=app, core_threshold=1e-50, \
-                lower_threshold=1e-20, step=10000)
-        self.assertEqual(result[0],\
-                [('gi|100002553', '0.0'), ('gi|100002554', '0.0')])
-        self.assertEqual(result[1], 4)
-        #if n=2, it should find the same sequences but only run for 1 iteration
-        #since it would hit n after the first blast search
-        result = ids_from_seq_lower_threshold(query, n=2, \
-                max_iterations=4, app=app, core_threshold=1e-50, \
-                lower_threshold=1e-20, step=10000)
-        self.assertEqual(result[0],\
-                [('gi|100002553', '0.0'), ('gi|100002554', '0.0')])
-        self.assertEqual(result[1], 1)
-        query = self.query_2.split('\n')
-        #query_2_s e-value for itself is 9e-47, it should not be found
-        #with the lower_threshold set to 1e-48
-        result = ids_from_seq_lower_threshold(query, n=12, \
-                max_iterations=4, app=app, core_threshold=1e-50, \
-                lower_threshold=1e-48, step=10000)
-        self.assertEqual(result[0], [])
-        #it also should not be found if the max_iterations is set to 1
-        result = ids_from_seq_lower_threshold(query, n=12, \
-                max_iterations=1, app=app, core_threshold=1e-50, \
-                lower_threshold=1e-20, step=10000)
-        self.assertEqual(result[0], [])
-        for fname in ['formatdb.log'] + glob('test_bdb*'):
-            remove(fname)
-
-    def test_psiblast_n_neighbors(self):
-        "psiblast_n_neighbors psiblasts and stops when n neighbors are reached"
-        bdb_seqs = self.fasta_recs
-        f = open('test_bdb', 'w')
-        f.write(bdb_seqs)
-        f.close()
-        temp = popen('formatdb -i test_bdb -o T -p T')
-        params = {'-j':11}
-        lines = bdb_seqs.split('\n')
-        results = psiblast_n_neighbors(lines, n=12, blast_db='test_bdb', \
-                method='lower_threshold', params=params,\
-                core_threshold=1e-50, step=10000)
-        #there should be 10 result entries since there were 10 queries
-        self.assertEqual(len(results), 10)
-        for i in results:
-            #each query should at least find itself
-            self.failUnless(len(results[i][0]) >= 1)
-            #each query should iterate 8 times since it can never reach max
-            self.assertEqual(results[i][1], 11)
-        for fname in ['formatdb.log'] + glob('test_bdb*'):
-            remove(fname)
-        
 
 def wrap_qmes(qmes):
     """Converts qmes into a dict of {q:{m:e}}"""
--- a/tests/test_app/test_formatdb.py
+++ b/tests/test_app/test_formatdb.py
@@ -76,120 +76,6 @@ class FormatDbTests(TestCase):
             self.assertFalse(exists(outpath),\
              "%s was not cleaned up." % outpath)
     
-    def test_blast_against_new_db(self):
-        """Formatdb: blastall against a newly created DB functions as expected
-        """
-        fdb = FormatDb(WorkingDir='/tmp')
-        result = fdb(self.in_seqs1_fp)
-        blast_res = blastn(self.test_seq,blast_db=self.in_seqs1_fp)
-        result.cleanUp()
-        
-        # Test that a blast result was returned
-        self.assertTrue('s1' in blast_res,\
-         "Not getting any blast results.")
-        # Test that the sequence we expect was a good blast hit
-        subject_ids = [r['SUBJECT ID'] for r in blast_res['s1'][0]]
-        self.assertTrue('11472384' in subject_ids,\
-         "Not getting expected blast results.")
-         
-    def test_build_blast_db_from_seqs(self):
-        """build_blast_db_from_seqs convenience function works as expected
-        """
-        blast_db, db_files = build_blast_db_from_seqs(self.in_seqs1,output_dir='/tmp')
-        self.assertTrue(blast_db.startswith('/tmp/Blast_tmp_db'))
-        self.assertTrue(blast_db.endswith('.fasta'))
-        expected_db_files = set([blast_db + ext\
-         for ext in ['.nhr','.nin','.nsq','.nsd','.nsi','.log']])
-        self.assertEqual(set(db_files),expected_db_files)
-        
-        # result returned when blasting against new db
-        self.assertEqual(\
-            len(blastn(self.test_seq,blast_db=blast_db)),1)
-            
-        # Make sure all db_files exist
-        for fp in db_files:
-            self.assertTrue(exists(fp))
-        
-        # Remove all db_files exist   
-        remove_files(db_files)
-        
-        # Make sure nothing weird happened in the remove
-        for fp in db_files:
-            self.assertFalse(exists(fp))
-        
-    def test_build_blast_db_from_fasta_path(self):
-        """build_blast_db_from_fasta_path convenience function works as expected
-        """
-        blast_db, db_files = \
-         build_blast_db_from_fasta_path(self.in_seqs1_fp)
-        self.assertEqual(blast_db,self.in_seqs1_fp)
-        expected_db_files = set([self.in_seqs1_fp + ext\
-         for ext in ['.nhr','.nin','.nsq','.nsd','.nsi','.log']])
-        self.assertEqual(set(db_files),expected_db_files)
-
-        # result returned when blasting against new db
-        self.assertEqual(\
-            len(blastn(self.test_seq,blast_db=blast_db)),1)
-
-        # Make sure all db_files exist
-        for fp in db_files:
-            self.assertTrue(exists(fp))
-        
-        # Remove all db_files exist   
-        remove_files(db_files)
-        
-        # Make sure nothing weird happened in the remove
-        for fp in db_files:
-            self.assertFalse(exists(fp))
-            
-    def test_build_blast_db_from_fasta_path_aln(self):
-        """build_blast_db_from_fasta_path works with alignment as input
-        """
-        blast_db, db_files = build_blast_db_from_fasta_path(self.in_aln1_fp)
-        self.assertEqual(blast_db,self.in_aln1_fp)
-        expected_db_files = set([blast_db + ext\
-         for ext in ['.nhr','.nin','.nsq','.nsd','.nsi','.log']])
-        self.assertEqual(set(db_files),expected_db_files)
-        # result returned when blasting against new db
-        self.assertEqual(\
-            len(blastn(self.test_seq,blast_db=blast_db,e_value=0.0)),1)
-        
-        # Make sure all db_files exist
-        for fp in db_files:
-            self.assertTrue(exists(fp))
-        
-        # Remove all db_files exist   
-        remove_files(db_files)
-        
-        # Make sure nothing weird happened in the remove
-        for fp in db_files:
-            self.assertFalse(exists(fp))
-            
-    def test_build_blast_db_from_fasta_file(self):
-        """build_blast_db_from_fasta_file works with open files as input
-        """
-        blast_db, db_files = \
-         build_blast_db_from_fasta_file(open(self.in_aln1_fp),output_dir='/tmp/')
-        self.assertTrue(blast_db.startswith('/tmp/BLAST_temp_db'))
-        self.assertTrue(blast_db.endswith('.fasta'))
-        expected_db_files = set([blast_db] + [blast_db + ext\
-         for ext in ['.nhr','.nin','.nsq','.nsd','.nsi','.log']])
-        self.assertEqual(set(db_files),expected_db_files)
-        # result returned when blasting against new db
-        self.assertEqual(\
-            len(blastn(self.test_seq,blast_db=blast_db,e_value=0.0)),1)
-        
-        # Make sure all db_files exist
-        for fp in db_files:
-            self.assertTrue(exists(fp))
-        
-        # Remove all db_files exist   
-        remove_files(db_files)
-        
-        # Make sure nothing weird happened in the remove
-        for fp in db_files:
-            self.assertFalse(exists(fp))
-        
 
 in_seqs1 = """>11472286
 GATGAACGCTGGCGGCATGCTTAACACATGCAAGTCGAACGGAACACTTTGTGTTTTGAGTTAATAGTTCGATAGTAGATAGTAAATAGTGAACACTATGAACTAGTAAACTATTTAACTAGAAACTCTTAAACGCAGAGCGTTTAGTGGCGAACGGGTGAGTAATACATTGGTATCTACCTCGGAGAAGGACATAGCCTGCCGAAAGGTGGGGTAATTTCCTATAGTCCCCGCACATATTTGTTCTTAAATCTGTTAAAATGATTATATGTTTTATGTTTATTTGATAAAAAGCAGCAAGACAAATGAGTTTTATATTGGTTATACAGCAGATTTAAAAAATAGAATTAGGTCTCATAATCAGGGAGAAAACAAATCAACTAAATCTAAAATACCTTGGGAATTGGTTTACTATGAAGCCTACAAAAACCAAACATCAGCAAGGGTTAGAGAATCAAAGTTGAAACATTATGGGCAATCATTAACTAGACTTAAGAGAAGAATTGGTTTTTGAGAACAAATATGTGCGGGGTAAAGCAGCAATGCGCTCCGAGAGGAACCTCTGTCCTATCAGCTTGTTGGTAAGGTAATGGCTTACCAAGGCGACGACGGGTAGCTGGTGTGAGAGCACGACCAGCCACACTGGGACTGAGACACGGCCCAGACTCCTACGGGAGGCAGCAGTGAGGAATTTTCCACAATGGGCGCAAGCCTGATGGAGCAATGCCGCGTGAAGGATGAAGATTTTCGGATTGTAAACTTCTTTTAAGTAGGAAGATTATGACGGTACTACTTGAATAAGCATCGGCTAACTACGTGCCAGCAGCCGCGGTAATACGTAGGATGCAAGCGTTATCCGGAATTACTGGGCGTAAAGCGTGTGTAGGTGGTTTATTAAGTTAAATGTTAAATTTTCAGGCTTAACTTGGAAACCGCATTTAATACTGGTAGACTTTGAGGACAAGAGAGGCAGGCGGAATTAGCGGAGTAGCGGTGAAATGCGTAGATATCGCTAAGAACACCAATGGCGAAGGCAGCCTGCTGGTTTGCACCTGACACTGAGATACGAAAGCGTGGGGAGCGAACGGGATTAGATACCCCGGTAGTCCACGCCGTAAACGATGGTCACTAGCTGTTAGGGGCTCGACCCCTTTAGTAGCGAAGCTAACGCGTTAAGTGACCCGCCTGGGGAGTACGATCGCAAGATTAAAACTCAAAGGAATTGACGGGGACCCGCACAAGCGGTGGAACGTGAGGTTTAATTCGTCTCTAAGCGAAAAACCTTACCGAGGCTTGACATCTCCGGAAGACCTTAGAAATAAGGTTGTGCCCGAAAGGGAGCCGGATGACAGGTGCTGCATGGCTGTCGTCAGCTCGTGTTGTGAAATGTTCGGTTAAGTCCGTTAACGAGCGCAACCCTTGCTGTGTGTTGTATTTTTCACACAGGACTATCCTGGTCAACAGGGAGGAAGGTGGGGATGACGTCAAGTCAGCATGGCTCTTACGCCTCGGGCTACACTCGCGTTACAATGGCCGGTACAATGGGCTGCCAACTCGTAAGGGGGAGCTAATCCCATCAAAACCGGTCCCAGTTCGGATTGAGGGCTGCAATTCGCCCTCATGAAGTCGGAATCGCTAGTAACCGCGAATCAGCACGTCGCGGTGAATGCGTTCTCGGGTCTTGTACACACTGCCCGTCACACCACGAAAGTTAGTAACGCCCGAAGTGCCCTGTATGGGGTCCTAAGGTGGGGCTAGCGATTGGGGTG
