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')

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 hugs length type successfully handles a length range .