mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Use dataclass properties in devolo_home_network tests (#60889)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
b70d24394e
commit
c04bfcc7f4
@ -1,5 +1,6 @@
|
||||
"""Tests for the devolo Home Network integration."""
|
||||
|
||||
import dataclasses
|
||||
from typing import Any
|
||||
|
||||
from devolo_plc_api.device_api.deviceapi import DeviceApi
|
||||
@ -27,5 +28,5 @@ def configure_integration(hass: HomeAssistant) -> MockConfigEntry:
|
||||
|
||||
async def async_connect(self, session_instance: Any = None):
|
||||
"""Give a mocked device the needed properties."""
|
||||
self.plcnet = PlcNetApi(IP, None, DISCOVERY_INFO)
|
||||
self.device = DeviceApi(IP, None, DISCOVERY_INFO)
|
||||
self.plcnet = PlcNetApi(IP, None, dataclasses.asdict(DISCOVERY_INFO))
|
||||
self.device = DeviceApi(IP, None, dataclasses.asdict(DISCOVERY_INFO))
|
||||
|
@ -30,8 +30,8 @@ def mock_device():
|
||||
def mock_validate_input():
|
||||
"""Mock setup entry and user input."""
|
||||
info = {
|
||||
"serial_number": DISCOVERY_INFO["properties"]["SN"],
|
||||
"title": DISCOVERY_INFO["properties"]["Product"],
|
||||
"serial_number": DISCOVERY_INFO.properties["SN"],
|
||||
"title": DISCOVERY_INFO.properties["Product"],
|
||||
}
|
||||
|
||||
with patch(
|
||||
|
@ -99,7 +99,7 @@ async def test_zeroconf(hass: HomeAssistant):
|
||||
|
||||
assert (
|
||||
context["title_placeholders"][CONF_NAME]
|
||||
== DISCOVERY_INFO["hostname"].split(".", maxsplit=1)[0]
|
||||
== DISCOVERY_INFO.hostname.split(".", maxsplit=1)[0]
|
||||
)
|
||||
|
||||
with patch(
|
||||
|
Loading…
x
Reference in New Issue
Block a user