def test_accept_custom_exception_text():
 custom_converter = (lambda value: (value + ' converted'))
 custom_type = hug.types.accept(custom_converter, 'A string Value', 'Error occurred')
 assert (custom_type('bacon') == 'bacon converted')
 with pytest.raises(ValueError):
  custom_type(1)

def test_accept_custom_exception_text ( ) : custom_converter = ( lambda value : ( value + ' converted' ) ) custom_type = hug . types . accept ( custom_converter , 'A string Value' , 'Error occurred' ) assert ( custom_type ( 'bacon' ) == 'bacon converted' ) with pytest . raises ( ValueError ) : custom_type ( 1 )
tests to ensure its easy to custom the exception text using the accept wrapper .