Revert Zeroconf back to previously used library (#24139)
* Revert back to previously used library * Fix test * Remove unused import * Fix import * Update __init__.py * Update __init__.py * Fix test after rebase
This commit is contained in:
1 parent
42ee8eef50
commit
84baaa324c
9 files changed
+42
-43
No files matched your search
@@ -1,7 +1,7 @@
|
||||
"""Test Zeroconf component setup process."""
|
||||
from unittest.mock import patch
|
||||
|
||||
from aiozeroconf import ServiceInfo, ServiceStateChange
|
||||
from zeroconf import ServiceInfo, ServiceStateChange
|
||||
|
||||
from homeassistant.generated import zeroconf as zc_gen
|
||||
from homeassistant.setup import async_setup_component
|
||||
@@ -11,11 +11,11 @@ from homeassistant.components import zeroconf
|
||||
def service_update_mock(zeroconf, service, handlers):
|
||||
"""Call service update handler."""
|
||||
handlers[0](
|
||||
None, service, '{}.{}'.format('name', service),
|
||||
zeroconf, service, '{}.{}'.format('name', service),
|
||||
ServiceStateChange.Added)
|
||||
|
||||
|
||||
async def get_service_info_mock(service_type, name):
|
||||
def get_service_info_mock(service_type, name):
|
||||
"""Return service info for get_service_info."""
|
||||
return ServiceInfo(
|
||||
service_type, name, address=b'\n\x00\x00\x14', port=80, weight=0,
|
||||
@@ -35,7 +35,6 @@ async def test_setup(hass):
|
||||
|
||||
assert await async_setup_component(
|
||||
hass, zeroconf.DOMAIN, {zeroconf.DOMAIN: {}})
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert len(MockServiceBrowser.mock_calls) == len(zc_gen.SERVICE_TYPES)
|
||||
assert len(mock_config_flow.mock_calls) == len(zc_gen.SERVICE_TYPES)
|
||||
assert len(MockServiceBrowser.mock_calls) == len(zc_gen.ZEROCONF)
|
||||
assert len(mock_config_flow.mock_calls) == len(zc_gen.ZEROCONF) * 2
|
||||
Reference in new issue
Block a user