def test_filter_bam(testdir, mock_testclass):
    samples = Path(__file__).parent.joinpath('samples.txt')
    fb.filter_bam_sample = MagicMock()
    fb.filter_bam(samples)
    fb.filter_bam_sample.assert_any_call('POLR2A', True, True, None, '', '')
    fb.filter_bam_sample.assert_any_call('ASDURF', True, True, None, '', '')
    fb.filter_bam_sample.assert_any_call('POLR1C', True, True, None, '', '')
def test_filter_bam_second(testdir, mock_testclass):
    samples = Path(__file__).parent.joinpath('samples.txt')
    threads = 2
    fb.filter_bam_sample = MagicMock()
    fb.filter_bam(samples, False, True, threads, index=1)
    fb.filter_bam_sample.assert_called_once_with('ASDURF', False, True,
                                                 threads, '', '')
def test_filter_bam_parameters(testdir, mock_testclass):
    samples = Path(__file__).parent.joinpath('samples.txt')
    threads = 2
    input_suffix = '-i-sacCer'
    output_suffix = '-sacCer'
    fb.filter_bam_sample = MagicMock()
    fb.filter_bam(samples, False, False, threads, input_suffix, output_suffix)
    fb.filter_bam_sample.assert_any_call('POLR2A', False, False, threads,
                                         input_suffix, output_suffix)
    fb.filter_bam_sample.assert_any_call('ASDURF', False, False, threads,
                                         input_suffix, output_suffix)
    fb.filter_bam_sample.assert_any_call('POLR1C', False, False, threads,
                                         input_suffix, output_suffix)