def test_find_lane_bases_hollow_lane():
    a = BinaryImage(
        np.array([[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0],
                  [0, 0, 0, 0, 0, 0, 0], [1, 0, 1, 0, 1, 0, 1],
                  [1, 0, 1, 0, 1, 0, 1], [1, 0, 1, 0, 1, 0, 1]]))

    (left_lane_base, right_lane_base) = a.lane_bases(midpoint_x=3)
    assert left_lane_base == 1
    assert right_lane_base == 5
def test_find_lane_bases_multiple_candidates():
    a = BinaryImage(
        np.array([[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0],
                  [0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 0, 0, 1, 1],
                  [1, 1, 1, 0, 1, 1, 1], [1, 1, 1, 0, 1, 1, 1]]))

    (left_lane_base, right_lane_base) = a.lane_bases(midpoint_x=3)
    assert left_lane_base == 1
    assert right_lane_base == 5