Exemplo n.º 1
0
def test_normalize_integer_selection():

    assert 1 == normalize_integer_selection(1, 100)
    assert 99 == normalize_integer_selection(-1, 100)
    with pytest.raises(IndexError):
        normalize_integer_selection(100, 100)
    with pytest.raises(IndexError):
        normalize_integer_selection(1000, 100)
    with pytest.raises(IndexError):
        normalize_integer_selection(-1000, 100)
Exemplo n.º 2
0
def test_normalize_integer_selection():

    eq(1, normalize_integer_selection(1, 100))
    eq(99, normalize_integer_selection(-1, 100))
    with assert_raises(IndexError):
        normalize_integer_selection(100, 100)
    with assert_raises(IndexError):
        normalize_integer_selection(1000, 100)
    with assert_raises(IndexError):
        normalize_integer_selection(-1000, 100)