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