Improve entity platform tests (#124051)

This commit is contained in:
Erik Montnemery 2024-08-16 15:08:37 +02:00 committed by GitHub
parent c717e7a6f6
commit 14a3217d7e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View File

@ -574,7 +574,7 @@ async def test_register_entity_service_non_entity_service_schema(
) )
# The check currently does not recurse into vol.All or vol.Any allowing these # The check currently does not recurse into vol.All or vol.Any allowing these
# non-compliatn schemas to pass # non-compliant schemas to pass
component.async_register_entity_service( component.async_register_entity_service(
"hello", vol.All(vol.Schema({"some": str})), Mock() "hello", vol.All(vol.Schema({"some": str})), Mock()
) )

View File

@ -1809,6 +1809,14 @@ async def test_register_entity_service_non_entity_service_schema(
vol.Schema({"some": str}), vol.Schema({"some": str}),
Mock(), Mock(),
) )
# The check currently does not recurse into vol.All or vol.Any allowing these
# non-compliant schemas to pass
entity_platform.async_register_entity_service(
"hello", vol.All(vol.Schema({"some": str})), Mock()
)
entity_platform.async_register_entity_service(
"hello", vol.Any(vol.Schema({"some": str})), Mock()
)
@pytest.mark.parametrize("update_before_add", [True, False]) @pytest.mark.parametrize("update_before_add", [True, False])