def test_docengine_to_int():
    """
    Test conversion from tree path to integer position in Doc sequence
    """
    position = [1, 2]
    authors = [0, 0]
    base_bits = 1

    test_pos = CharPosition(position, authors, base_bits=base_bits)

    assert test_pos.convert_to_int() == 6
def test_docengine_trim():
    """
    Test Doc tree position trimming function.
    """
    position = [1, 2]
    authors = [0, 0]
    trim_level = 1

    test_pos = CharPosition(position,
                            authors,
                            base_bits=CharPosition.BASE_BITS)

    assert test_pos.convert_to_int(trim=trim_level) == 1