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:
21
tests/components/alexa/test_config.py
Normal file
21
tests/components/alexa/test_config.py
Normal 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()
|
||||
Reference in New Issue
Block a user