def test_enum():
 class TestEnum(enum.Enum, ):
  'Test enum.'
  value1 = 'Value 1'
  value2 = 'Value 2'
 schema = vol.Schema(cv.enum(TestEnum))
 with pytest.raises(vol.Invalid):
  schema('value3')

def test_enum ( ) : class TestEnum ( enum . Enum , ) : value1 = 'Value 1' value2 = 'Value 2' schema = vol . Schema ( cv . enum ( TestEnum ) ) with pytest . raises ( vol . Invalid ) : schema ( 'value3' )
test enum validator .