Fix test RuntimeWarning for upb (#122325)
This commit is contained in:
parent
273dc0998f
commit
6de824e875
1 changed files with 2 additions and 1 deletions
|
@ -1,7 +1,7 @@
|
|||
"""Test the UPB Control config flow."""
|
||||
|
||||
from asyncio import TimeoutError
|
||||
from unittest.mock import AsyncMock, PropertyMock, patch
|
||||
from unittest.mock import AsyncMock, MagicMock, PropertyMock, patch
|
||||
|
||||
from homeassistant import config_entries
|
||||
from homeassistant.components.upb.const import DOMAIN
|
||||
|
@ -18,6 +18,7 @@ def mocked_upb(sync_complete=True, config_ok=True):
|
|||
upb_mock = AsyncMock()
|
||||
type(upb_mock).network_id = PropertyMock(return_value="42")
|
||||
type(upb_mock).config_ok = PropertyMock(return_value=config_ok)
|
||||
type(upb_mock).disconnect = MagicMock()
|
||||
if sync_complete:
|
||||
upb_mock.async_connect.side_effect = _upb_lib_connect
|
||||
return patch(
|
||||
|
|
Loading…
Add table
Reference in a new issue