def test_uuid():
 assert (hug.types.uuid('{12345678-1234-5678-1234-567812345678}') == UUID('12345678-1234-5678-1234-567812345678'))
 assert (hug.types.uuid('12345678-1234-5678-1234-567812345678') == UUID('12345678123456781234567812345678'))
 assert (hug.types.uuid('12345678123456781234567812345678') == UUID('12345678-1234-5678-1234-567812345678'))
 assert (hug.types.uuid('urn:uuid:12345678-1234-5678-1234-567812345678') == UUID('12345678-1234-5678-1234-567812345678'))
 with pytest.raises(ValueError):
  hug.types.uuid(1)
 with pytest.raises(ValueError):
  hug.types.uuid('12345678-1234-5678-1234-56781234567G')
 with pytest.raises(ValueError):
  hug.types.uuid('12345678-1234-5678-1234-5678123456781')
 with pytest.raises(ValueError):
  hug.types.uuid('12345678-1234-5678-1234-56781234567')

def test_uuid ( ) : assert ( hug . types . uuid ( '{12345678-1234-5678-1234-567812345678}' ) == UUID ( '12345678-1234-5678-1234-567812345678' ) ) assert ( hug . types . uuid ( '12345678-1234-5678-1234-567812345678' ) == UUID ( '12345678123456781234567812345678' ) ) assert ( hug . types . uuid ( '12345678123456781234567812345678' ) == UUID ( '12345678-1234-5678-1234-567812345678' ) ) assert ( hug . types . uuid ( 'urn:uuid:12345678-1234-5678-1234-567812345678' ) == UUID ( '12345678-1234-5678-1234-567812345678' ) ) with pytest . raises ( ValueError ) : hug . types . uuid ( 1 ) with pytest . raises ( ValueError ) : hug . types . uuid ( '12345678-1234-5678-1234-56781234567G' ) with pytest . raises ( ValueError ) : hug . types . uuid ( '12345678-1234-5678-1234-5678123456781' ) with pytest . raises ( ValueError ) : hug . types . uuid ( '12345678-1234-5678-1234-56781234567' )
tests that hugs text validator correctly handles uuid values examples were taken from URL .