Exemplo n.º 1
0
    def test_load_one_file_2(self, insert_sequences_batch, info):
        db.BATCH_SIZE = 5

        file_1 = join('tests', 'data', 'load_seq2.txt')
        atram_preprocessor.load_one_file(self.db_conn, file_1, 'mixed_ends')

        msg = 'Loading "{}" into sqlite database'.format(file_1)
        info.assert_called_once_with(msg)

        calls = [
            call(self.db_conn, [('seq6', '1', 'TTTTTTTTTT'),
                                ('seq7', '1', 'TTTTTTTTTTCCCCCCCCCC'),
                                ('seq8/a.1 suffix', '', 'TTTTTTTTTT'),
                                ('seq8', '2', 'TTTTTTTTTTCCCCCCCCCC')])
        ]
        insert_sequences_batch.assert_has_calls(calls)
Exemplo n.º 2
0
    def test_load_one_file_end1(self, insert_sequences_batch, info):
        db.BATCH_SIZE = 5

        file_1 = join('tests', 'data', 'load_seq1.txt')
        atram_preprocessor.load_one_file(self.db_conn, file_1, 'end_1', '1')

        msg = 'Loading "{}" into sqlite database'.format(file_1)
        info.assert_called_once_with(msg)

        calls = [
            call(self.db_conn, [('seq1', '1', 'AAAAAAAAAA'),
                                ('seq2', '1', 'AAAAAAAAAAGGGGGGGGGG'),
                                ('seq3', '1', 'AAAAAAAAAA'),
                                ('seq4', '1', 'AAAAAAAAAA'),
                                ('seq5/3', '1', 'AAAAAAAAAAGGGGGGGGGG')]),
            call(self.db_conn, [('seq1', '1', 'AAAAAAAAAA'),
                                ('seq2', '1', 'AAAAAAAAAAGGGGGGGGGG'),
                                ('seq3', '1', 'AAAAAAAAAA'),
                                ('seq4', '1', 'AAAAAAAAAAGGGGGGGGGG')])
        ]
        insert_sequences_batch.assert_has_calls(calls)