mirror of
https://github.com/home-assistant/core.git
synced 2025-11-08 02:19:31 +00:00
Allow custom_serializer to recognize cv.string and cv.boolean to make config schema more reusable (#41532)
This commit is contained in:
@@ -571,6 +571,27 @@ def test_multi_select_in_serializer():
|
||||
}
|
||||
|
||||
|
||||
def test_boolean_in_serializer():
|
||||
"""Test boolean with custom_serializer."""
|
||||
assert cv.custom_serializer(cv.boolean) == {
|
||||
"type": "boolean",
|
||||
}
|
||||
|
||||
|
||||
def test_string_in_serializer():
|
||||
"""Test string with custom_serializer."""
|
||||
assert cv.custom_serializer(cv.string) == {
|
||||
"type": "string",
|
||||
}
|
||||
|
||||
|
||||
def test_positive_time_period_dict_in_serializer():
|
||||
"""Test positive_time_period_dict with custom_serializer."""
|
||||
assert cv.custom_serializer(cv.positive_time_period_dict) == {
|
||||
"type": "positive_time_period_dict",
|
||||
}
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def schema():
|
||||
"""Create a schema used for testing deprecation."""
|
||||
|
||||
Reference in New Issue
Block a user