def test_int_converter_invalid_config(num_digits):
    with pytest.raises(ValueError):
        converters.IntConverter(num_digits)
def test_int_converter_malformed(fragment):
    c = converters.IntConverter()
    assert c.convert(fragment) is None
def test_int_converter(fragment, num_digits, min, max, expected):
    c = converters.IntConverter(num_digits, min, max)
    assert c.convert(fragment) == expected
Esempio n. 4
0
def test_int_converter_malformed(value):
    c = converters.IntConverter()
    assert c.convert(value) is None
Esempio n. 5
0
def test_int_converter(value, num_digits, min, max, expected):
    c = converters.IntConverter(num_digits, min, max)
    assert c.convert(value) == expected
Esempio n. 6
0
def test_int_filter_malformed(segment):
    c = converters.IntConverter()
    assert c.convert(segment) is None