Exemplo n.º 1
0
def test_min_max_greater_than():
    with pytest.raises(ValidationError):
        range_(10, 20)(21)
Exemplo n.º 2
0
def test_valid():
    value = range_(min_value=3, max_value=5)(4)
    assert value == 4
Exemplo n.º 3
0
def test_min_max_middle():
    range_(10, 20)(15)
Exemplo n.º 4
0
def test_min_max_equal_max():
    range_(10, 20)(20)
Exemplo n.º 5
0
def test_max_greater_than():
    with pytest.raises(ValidationError):
        range_(max_value=10)(11)
Exemplo n.º 6
0
def test_min_max_less_than():
    with pytest.raises(ValidationError):
        range_(10, 20)(5)
Exemplo n.º 7
0
def test_max_equal():
    range_(max_value=10)(10)
Exemplo n.º 8
0
def test_max_less_than():
    range_(max_value=10)(9)
Exemplo n.º 9
0
def test_min_greater_than():
    range_(min_value=10)(11)
Exemplo n.º 10
0
def test_min_equal():
    range_(min_value=10)(10)
Exemplo n.º 11
0
def test_min_less_than():
    with pytest.raises(ValidationError):
        range_(min_value=10)(9)