Only load services.yaml for integrations that have it (#112732)

Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
Paulus Schoutsen
2024-03-11 14:05:32 -04:00
committed by GitHub
parent ec89886fac
commit 145657dc21
7 changed files with 43 additions and 7 deletions

View File

@@ -1685,3 +1685,11 @@ async def test_integration_warnings(
"""Test integration warnings."""
await loader.async_get_integration(hass, "test_package_loaded_loop")
assert "configured to to import its code in the event loop" in caplog.text
async def test_has_services(hass: HomeAssistant, enable_custom_integrations) -> None:
"""Test has_services."""
integration = await loader.async_get_integration(hass, "test")
assert integration.has_services is False
integration = await loader.async_get_integration(hass, "test_with_services")
assert integration.has_services is True