def test_length():
    assert hug.types.length(1, 10)('bacon') == 'bacon'
    assert hug.types.length(1, 10)(42) == '42'
    assert '42' in hug.types.length(1, 42).__doc__
    with pytest.raises(ValueError):
        hug.types.length(1, 10)('bacon is the greatest food known to man')
    with pytest.raises(ValueError):
        hug.types.length(1, 10)('')
    with pytest.raises(ValueError):
        hug.types.length(1, 10)('bacon is th')
Tests that hug's length type successfully handles a length range
dataset/ETHPy150Open timothycrosley/hug/tests/test_types.py/test_length