Exemplo n.º 1
0
def test_require_int_too_high():
    with pytest.raises(template_filters.IntegerTooLarge):
        template_filters.require_int("1", max=0)
Exemplo n.º 2
0
def test_require_int_not_an_int():
    with pytest.raises(template_filters.IntegerRequired):
        template_filters.require_int("abc")
Exemplo n.º 3
0
def test_require_int_too_low():
    with pytest.raises(template_filters.IntegerTooSmall):
        template_filters.require_int("-1", min=0)
Exemplo n.º 4
0
def test_require_int():
    i = template_filters.require_int("1")
    assert i == 1
Exemplo n.º 5
0
def test_require_int_in_range():
    i = template_filters.require_int("1", min=0, max=5)
    assert i == 1
Exemplo n.º 6
0
def test_require_int_too_high():
    with pytest.raises(template_filters.IntegerTooLarge):
        template_filters.require_int("1", max=0)
Exemplo n.º 7
0
def test_require_int_too_low():
    with pytest.raises(template_filters.IntegerTooSmall):
        template_filters.require_int("-1", min=0)
Exemplo n.º 8
0
def test_require_int_not_an_int():
    with pytest.raises(template_filters.IntegerRequired):
        template_filters.require_int("abc")
Exemplo n.º 9
0
def test_require_int_in_range():
    i = template_filters.require_int("1", min=0, max=5)
    assert i == 1
Exemplo n.º 10
0
def test_require_int():
    i = template_filters.require_int("1")
    assert i == 1