Add tls support for AVM Fritz!Tools (#112714)

This commit is contained in:
r-binder 2024-04-20 23:08:29 +02:00 committed by GitHub
parent b450918f66
commit 68225abce5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 210 additions and 51 deletions

View file

@ -74,16 +74,6 @@ class FritzConnectionMock:
return self._services[service][action]
class FritzHostMock(FritzHosts):
"""FritzHosts mocking."""
get_mesh_topology = MagicMock()
get_mesh_topology.return_value = MOCK_MESH_DATA
get_hosts_attributes = MagicMock()
get_hosts_attributes.return_value = MOCK_HOST_ATTRIBUTES_DATA
@pytest.fixture(name="fc_data")
def fc_data_mock():
"""Fixture for default fc_data."""
@ -105,6 +95,8 @@ def fh_class_mock():
"""Fixture that sets up a mocked FritzHosts class."""
with patch(
"homeassistant.components.fritz.common.FritzHosts",
new=FritzHostMock,
new=FritzHosts,
) as result:
result.get_mesh_topology = MagicMock(return_value=MOCK_MESH_DATA)
result.get_hosts_attributes = MagicMock(return_value=MOCK_HOST_ATTRIBUTES_DATA)
yield result