Fix formatting of mac addresses from dhcp discovery mocking in axis (#110560)
dhcp returns addresses in lowercase without :
This commit is contained in:
parent
d48a45fee7
commit
8da07f1bf2
1 changed files with 8 additions and 5 deletions
|
@ -32,11 +32,14 @@ from homeassistant.const import (
|
|||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.data_entry_flow import FlowResultType
|
||||
from homeassistant.helpers import device_registry as dr
|
||||
|
||||
from .const import DEFAULT_HOST, MAC, MODEL, NAME
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
|
||||
DHCP_FORMATTED_MAC = dr.format_mac(MAC).replace(":", "")
|
||||
|
||||
|
||||
@pytest.fixture(name="mock_config_entry")
|
||||
async def mock_config_entry_fixture(hass, config_entry, mock_setup_entry):
|
||||
|
@ -253,7 +256,7 @@ async def test_reauth_flow_update_configuration(
|
|||
dhcp.DhcpServiceInfo(
|
||||
hostname=f"axis-{MAC}",
|
||||
ip=DEFAULT_HOST,
|
||||
macaddress=MAC,
|
||||
macaddress=DHCP_FORMATTED_MAC,
|
||||
),
|
||||
),
|
||||
(
|
||||
|
@ -360,7 +363,7 @@ async def test_discovery_flow(
|
|||
dhcp.DhcpServiceInfo(
|
||||
hostname=f"axis-{MAC}",
|
||||
ip=DEFAULT_HOST,
|
||||
macaddress=MAC,
|
||||
macaddress=DHCP_FORMATTED_MAC,
|
||||
),
|
||||
),
|
||||
(
|
||||
|
@ -412,7 +415,7 @@ async def test_discovered_device_already_configured(
|
|||
dhcp.DhcpServiceInfo(
|
||||
hostname=f"axis-{MAC}",
|
||||
ip="2.3.4.5",
|
||||
macaddress=MAC,
|
||||
macaddress=DHCP_FORMATTED_MAC,
|
||||
),
|
||||
80,
|
||||
),
|
||||
|
@ -488,7 +491,7 @@ async def test_discovery_flow_updated_configuration(
|
|||
dhcp.DhcpServiceInfo(
|
||||
hostname="",
|
||||
ip="",
|
||||
macaddress="01234567890",
|
||||
macaddress=dr.format_mac("01234567890").replace(":", ""),
|
||||
),
|
||||
),
|
||||
(
|
||||
|
@ -537,7 +540,7 @@ async def test_discovery_flow_ignore_non_axis_device(
|
|||
dhcp.DhcpServiceInfo(
|
||||
hostname=f"axis-{MAC}",
|
||||
ip="169.254.3.4",
|
||||
macaddress=MAC,
|
||||
macaddress=DHCP_FORMATTED_MAC,
|
||||
),
|
||||
),
|
||||
(
|
||||
|
|
Loading…
Add table
Reference in a new issue