From 14a3217d7e3b871b492184512d4e9b4b01826203 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Fri, 16 Aug 2024 15:08:37 +0200 Subject: [PATCH] Improve entity platform tests (#124051) --- tests/helpers/test_entity_component.py | 2 +- tests/helpers/test_entity_platform.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/helpers/test_entity_component.py b/tests/helpers/test_entity_component.py index 230944e6a96..5ce0292c2ec 100644 --- a/tests/helpers/test_entity_component.py +++ b/tests/helpers/test_entity_component.py @@ -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 - # non-compliatn schemas to pass + # non-compliant schemas to pass component.async_register_entity_service( "hello", vol.All(vol.Schema({"some": str})), Mock() ) diff --git a/tests/helpers/test_entity_platform.py b/tests/helpers/test_entity_platform.py index 50180ecd844..fcbc825bbdc 100644 --- a/tests/helpers/test_entity_platform.py +++ b/tests/helpers/test_entity_platform.py @@ -1809,6 +1809,14 @@ async def test_register_entity_service_non_entity_service_schema( vol.Schema({"some": str}), 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])