Exemplo n.º 1
0
def test_values_bump():
    func = ValuesFunction([0, 5, 10])
    with pytest.raises(ValueError):
        func.bump(10)
Exemplo n.º 2
0
def test_values_bump():
    func = ValuesFunction([0, 5, 10])
    assert func.bump(0) == 5
Exemplo n.º 3
0
def test_values_init_w_incorrect_first_value():
    with pytest.raises(ValueError):
        func = ValuesFunction([0, 1, 2], first_value=3)
Exemplo n.º 4
0
def test_values_init_w_empty_values():
    with pytest.raises(ValueError):
        func = ValuesFunction([])
Exemplo n.º 5
0
def test_values_init_w_correct_optional_and_first_value():
    func = ValuesFunction([0, 1, 2], optional_value=0, first_value=1)
    assert func.optional_value == 0
    assert func.first_value == 1
Exemplo n.º 6
0
def test_values_init():
    func = ValuesFunction([0, 1, 2])
    assert func.optional_value == 0
    assert func.first_value == 0