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