Exemplo n.º 1
0
def test_count_cigar_ops_6():
    """
    Test a degenerate case.
    """

    cigar = '12345'
    expected = (0, 0, 0, 0)  # num_m, num_i, num_d, total_len

    with pytest.raises(Exception):
        result = mod.count_cigar_ops(cigar)
Exemplo n.º 2
0
def test_count_cigar_ops_2():
    """
    Test simple match ops, only one CIGAR op.
    """

    cigar = '10M'
    expected = (10, 0, 0, 10)  # num_m, num_i, num_d, total_len

    result = mod.count_cigar_ops(cigar)

    assert (result == expected)
Exemplo n.º 3
0
def test_count_cigar_ops_3():
    """
    Test a more complex CIGAR string.
    """

    cigar = '10M1I123D4=2X'
    expected = (16, 1, 123, 140)  # num_m, num_i, num_d, total_len

    result = mod.count_cigar_ops(cigar)

    assert (result == expected)
Exemplo n.º 4
0
def test_count_cigar_ops_1():
    """
    Test empty input.
    """

    cigar = ''
    expected = (0, 0, 0, 0)  # num_m, num_i, num_d, total_len

    result = mod.count_cigar_ops(cigar)

    assert (result == expected)