1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Fix race in Alexa async_enable_proactive_mode (#92785)

This commit is contained in:
Erik Montnemery
2023-05-09 19:58:00 +02:00
committed by GitHub
parent 67c1051305
commit 7d29d584fd
2 changed files with 29 additions and 10 deletions

View File

@@ -0,0 +1,21 @@
"""Test config."""
import asyncio
from unittest.mock import patch
from homeassistant.core import HomeAssistant
from .test_common import get_default_config
async def test_enable_proactive_mode_in_parallel(hass: HomeAssistant) -> None:
"""Test enabling proactive mode does not happen in parallel."""
config = get_default_config(hass)
with patch(
"homeassistant.components.alexa.config.async_enable_proactive_mode"
) as mock_enable_proactive_mode:
await asyncio.gather(
config.async_enable_proactive_mode(), config.async_enable_proactive_mode()
)
mock_enable_proactive_mode.assert_awaited_once()