mirror of
https://github.com/home-assistant/core.git
synced 2025-11-11 03:50:55 +00:00
Migrate remaining get_platform in check_config to async_get_platform (#112470)
These were very likely to be cached so they were low on the list to migrate, but since they are called in the event loop its best to be sure we do no blocking I/O
This commit is contained in:
@@ -338,7 +338,7 @@ async def test_config_platform_import_error(hass: HomeAssistant) -> None:
|
||||
# Make sure they don't exist
|
||||
files = {YAML_CONFIG_FILE: BASE_CONFIG + "light:\n platform: beer"}
|
||||
with patch(
|
||||
"homeassistant.loader.Integration.get_platform",
|
||||
"homeassistant.loader.Integration.async_get_platform",
|
||||
side_effect=ImportError("blablabla"),
|
||||
), patch("os.path.isfile", return_value=True), patch_yaml_files(files):
|
||||
res = await async_check_ha_config_file(hass)
|
||||
@@ -358,7 +358,7 @@ async def test_platform_import_error(hass: HomeAssistant) -> None:
|
||||
# Make sure they don't exist
|
||||
files = {YAML_CONFIG_FILE: BASE_CONFIG + "light:\n platform: demo"}
|
||||
with patch(
|
||||
"homeassistant.loader.Integration.get_platform",
|
||||
"homeassistant.loader.Integration.async_get_platform",
|
||||
side_effect=[None, ImportError("blablabla")],
|
||||
), patch("os.path.isfile", return_value=True), patch_yaml_files(files):
|
||||
res = await async_check_ha_config_file(hass)
|
||||
|
||||
Reference in New Issue
Block a user