mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Add ESPHome update entities (#85717)
This commit is contained in:
@@ -40,6 +40,18 @@ def mock_config_entry() -> MockConfigEntry:
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_device_info() -> DeviceInfo:
|
||||
"""Return the default mocked device info."""
|
||||
return DeviceInfo(
|
||||
uses_password=False,
|
||||
name="test",
|
||||
bluetooth_proxy_version=0,
|
||||
mac_address="11:22:33:44:55:aa",
|
||||
esphome_version="1.0.0",
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
async def init_integration(
|
||||
hass: HomeAssistant, mock_config_entry: MockConfigEntry
|
||||
@@ -54,7 +66,7 @@ async def init_integration(
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_client():
|
||||
def mock_client(mock_device_info):
|
||||
"""Mock APIClient."""
|
||||
mock_client = Mock(spec=APIClient)
|
||||
|
||||
@@ -78,14 +90,7 @@ def mock_client():
|
||||
return mock_client
|
||||
|
||||
mock_client.side_effect = mock_constructor
|
||||
mock_client.device_info = AsyncMock(
|
||||
return_value=DeviceInfo(
|
||||
uses_password=False,
|
||||
name="test",
|
||||
bluetooth_proxy_version=0,
|
||||
mac_address="11:22:33:44:55:aa",
|
||||
)
|
||||
)
|
||||
mock_client.device_info = AsyncMock(return_value=mock_device_info)
|
||||
mock_client.connect = AsyncMock()
|
||||
mock_client.disconnect = AsyncMock()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user