From 3f547e58d773fa519c2e2c3a2a4da0b4aaedcd97 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 27 Apr 2021 23:47:36 -1000 Subject: [PATCH] Fix zeroconf test inadvertently matching strings that start with name (#49578) * Fix zeroconf test inadvertently matching strings that start with name * adjust * adjust --- tests/components/zeroconf/test_init.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/components/zeroconf/test_init.py b/tests/components/zeroconf/test_init.py index 61b444a5784..0ad15c947cf 100644 --- a/tests/components/zeroconf/test_init.py +++ b/tests/components/zeroconf/test_init.py @@ -58,7 +58,7 @@ def service_update_mock(zeroconf, services, handlers, *, limit_service=None): for service in services: if limit_service is not None and service != limit_service: continue - handlers[0](zeroconf, service, f"name.{service}", ServiceStateChange.Added) + handlers[0](zeroconf, service, f"_name.{service}", ServiceStateChange.Added) def get_service_info_mock(service_type, name): @@ -273,7 +273,7 @@ async def test_service_with_invalid_name(hass, mock_zeroconf, caplog): await hass.async_block_till_done() assert len(mock_service_browser.mock_calls) == 1 - assert "Failed to get info for device name" in caplog.text + assert "Failed to get info for device" in caplog.text async def test_zeroconf_match_macaddress(hass, mock_zeroconf):