Skip to content

Commit

Permalink
Fix formatting of mac addresses from dhcp discovery mocking in axis (#…
Browse files Browse the repository at this point in the history
…110560)

dhcp returns addresses in lowercase without :
  • Loading branch information
bdraco authored Feb 15, 2024
1 parent d48a45f commit 8da07f1
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tests/components/axis/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@
)
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):
Expand Down Expand Up @@ -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,
),
),
(
Expand Down Expand Up @@ -360,7 +363,7 @@ async def test_discovery_flow(
dhcp.DhcpServiceInfo(
hostname=f"axis-{MAC}",
ip=DEFAULT_HOST,
macaddress=MAC,
macaddress=DHCP_FORMATTED_MAC,
),
),
(
Expand Down Expand Up @@ -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,
),
Expand Down Expand Up @@ -488,7 +491,7 @@ async def test_discovery_flow_updated_configuration(
dhcp.DhcpServiceInfo(
hostname="",
ip="",
macaddress="01234567890",
macaddress=dr.format_mac("01234567890").replace(":", ""),
),
),
(
Expand Down Expand Up @@ -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,
),
),
(
Expand Down

0 comments on commit 8da07f1

Please sign in to comment.