def test_index(range_creator):
    build_range = range_creator.create(range(10))
    # no build_info fetched yet, so ValueError is raised
    with pytest.raises(ValueError):
        build_range.index(5)

    mid = build_range.mid_point()
    assert mid == 5
    assert mid == build_range.index(5)
Beispiel #2
0
def test_index(range_creator):
    build_range = range_creator.create(range(10))
    # no build_info fetched yet, so ValueError is raised
    with pytest.raises(ValueError):
        build_range.index(5)

    mid = build_range.mid_point()
    assert mid == 5
    assert mid == build_range.index(5)