Stringify enums in selectors (#71441)
This commit is contained in:
parent
1a00bb9fc4
commit
b1a04302b5
7 changed files with 18 additions and 15 deletions
|
@ -1,4 +1,6 @@
|
|||
"""Test selectors."""
|
||||
from enum import Enum
|
||||
|
||||
import pytest
|
||||
import voluptuous as vol
|
||||
|
||||
|
@ -52,6 +54,8 @@ def _test_selector(
|
|||
config = {selector_type: schema}
|
||||
selector.validate_selector(config)
|
||||
selector_instance = selector.selector(config)
|
||||
# We do not allow enums in the config, as they cannot serialize
|
||||
assert not any(isinstance(val, Enum) for val in selector_instance.config.values())
|
||||
|
||||
# Use selector in schema and validate
|
||||
vol_schema = vol.Schema({"selection": selector_instance})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue