Use DhcpServiceInfo in guardian tests (#59970)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
e23cc3ecbf
commit
01fea8bbdd
1 changed files with 11 additions and 12 deletions
|
@ -4,8 +4,7 @@ from unittest.mock import patch
|
|||
from aioguardian.errors import GuardianError
|
||||
|
||||
from homeassistant import data_entry_flow
|
||||
from homeassistant.components import zeroconf
|
||||
from homeassistant.components.dhcp import HOSTNAME, IP_ADDRESS, MAC_ADDRESS
|
||||
from homeassistant.components import dhcp, zeroconf
|
||||
from homeassistant.components.guardian import CONF_UID, DOMAIN
|
||||
from homeassistant.components.guardian.config_flow import (
|
||||
async_get_pin_from_discovery_hostname,
|
||||
|
@ -137,11 +136,11 @@ async def test_step_zeroconf_already_in_progress(hass):
|
|||
|
||||
async def test_step_dhcp(hass, ping_client):
|
||||
"""Test the dhcp step."""
|
||||
dhcp_data = {
|
||||
IP_ADDRESS: "192.168.1.100",
|
||||
HOSTNAME: "GVC1-ABCD.local.",
|
||||
MAC_ADDRESS: "aa:bb:cc:dd:ee:ff",
|
||||
}
|
||||
dhcp_data = dhcp.DhcpServiceInfo(
|
||||
ip="192.168.1.100",
|
||||
hostname="GVC1-ABCD.local.",
|
||||
macaddress="aa:bb:cc:dd:ee:ff",
|
||||
)
|
||||
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN, context={"source": SOURCE_DHCP}, data=dhcp_data
|
||||
|
@ -163,11 +162,11 @@ async def test_step_dhcp(hass, ping_client):
|
|||
|
||||
async def test_step_dhcp_already_in_progress(hass):
|
||||
"""Test the zeroconf step aborting because it's already in progress."""
|
||||
dhcp_data = {
|
||||
IP_ADDRESS: "192.168.1.100",
|
||||
HOSTNAME: "GVC1-ABCD.local.",
|
||||
MAC_ADDRESS: "aa:bb:cc:dd:ee:ff",
|
||||
}
|
||||
dhcp_data = dhcp.DhcpServiceInfo(
|
||||
ip="192.168.1.100",
|
||||
hostname="GVC1-ABCD.local.",
|
||||
macaddress="aa:bb:cc:dd:ee:ff",
|
||||
)
|
||||
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN, context={"source": SOURCE_DHCP}, data=dhcp_data
|
||||
|
|
Loading…
Add table
Reference in a new issue