def test_number():
 assert (hug.types.number('1') == 1)
 assert (hug.types.number(1) == 1)
 with pytest.raises(ValueError):
  hug.types.number('bacon')

def test_number ( ) : assert ( hug . types . number ( '1' ) == 1 ) assert ( hug . types . number ( 1 ) == 1 ) with pytest . raises ( ValueError ) : hug . types . number ( 'bacon' )
tests that hugs number type correctly converts and validates input .