示例#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)