The error case can be tested by e.g. executing test_index_generation(False, 5, 5).
Due to right and/or right_in being incremented during the last loop in the while loop above, their values become greater than (len_in-1), thus triggering the "cover the last image" case when it is not needed.
The error case can be tested by e.g. executing
test_index_generation(False, 5, 5)
.Due to
right
and/orright_in
being incremented during the last loop in the while loop above, their values become greater than(len_in-1)
, thus triggering the "cover the last image" case when it is not needed.