diff --git a/tests/components/fritz/conftest.py b/tests/components/fritz/conftest.py index 04e59082b272..98fa3c848f26 100644 --- a/tests/components/fritz/conftest.py +++ b/tests/components/fritz/conftest.py @@ -32,26 +32,6 @@ class FritzServiceMock(Service): self.serviceId = serviceId -class FritzResponseMock: - """Response mocking.""" - - def json(self): - """Mock json method.""" - return {"CPUTEMP": "69,68,67"} - - -class FritzHttpMock: - """FritzHttp mocking.""" - - def __init__(self) -> None: - """Init Mocking class.""" - self.router_url = "http://fritz.box" - - def call_url(self, *args, **kwargs): - """Mock call_url method.""" - return FritzResponseMock() - - class FritzConnectionMock: """FritzConnection mocking.""" @@ -64,7 +44,6 @@ class FritzConnectionMock: srv: FritzServiceMock(serviceId=srv, actions=actions) for srv, actions in services.items() } - self.http_interface = FritzHttpMock() LOGGER.debug("-" * 80) LOGGER.debug("FritzConnectionMock - services: %s", self.services) diff --git a/tests/components/fritz/snapshots/test_diagnostics.ambr b/tests/components/fritz/snapshots/test_diagnostics.ambr index aba450ba7841..8bf3416df490 100644 --- a/tests/components/fritz/snapshots/test_diagnostics.ambr +++ b/tests/components/fritz/snapshots/test_diagnostics.ambr @@ -13,9 +13,8 @@ ]), 'connection_type': 'WANPPPConnection', 'cpu_temperatures': list([ - 69, - 68, - 67, + 42, + 38, ]), 'current_firmware': '7.29', 'current_user_rights': dict({ diff --git a/tests/components/fritz/snapshots/test_sensor.ambr b/tests/components/fritz/snapshots/test_sensor.ambr index 4882deed76fc..7cb5e2a7a3a2 100644 --- a/tests/components/fritz/snapshots/test_sensor.ambr +++ b/tests/components/fritz/snapshots/test_sensor.ambr @@ -49,6 +49,63 @@ 'state': '2024-09-01T10:11:33+00:00', }) # --- +# name: test_sensor_setup[sensor.mock_title_cpu_temperature-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.mock_title_cpu_temperature', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'CPU temperature', + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 1, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'CPU temperature', + 'platform': 'fritz', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'cpu_temperature', + 'unique_id': '1C:ED:6F:12:34:11-cpu_temperature', + 'unit_of_measurement': , + }) +# --- +# name: test_sensor_setup[sensor.mock_title_cpu_temperature-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'temperature', + 'friendly_name': 'Mock Title CPU temperature', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.mock_title_cpu_temperature', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '42', + }) +# --- # name: test_sensor_setup[sensor.mock_title_download_throughput-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ @@ -841,60 +898,3 @@ 'state': '3.4', }) # --- -# name: test_sensor_setup[sensor.mock_title_cpu_temperature-entry] - EntityRegistryEntrySnapshot({ - 'aliases': set({ - }), - 'area_id': None, - 'capabilities': dict({ - 'state_class': , - }), - 'config_entry_id': , - 'config_subentry_id': , - 'device_class': None, - 'device_id': , - 'disabled_by': None, - 'domain': 'sensor', - 'entity_category': , - 'entity_id': 'sensor.mock_title_cpu_temperature', - 'has_entity_name': True, - 'hidden_by': None, - 'icon': None, - 'id': , - 'labels': set({ - }), - 'name': None, - 'object_id_base': 'CPU temperature', - 'options': dict({ - 'sensor': dict({ - 'suggested_display_precision': 1, - }), - }), - 'original_device_class': , - 'original_icon': None, - 'original_name': 'CPU temperature', - 'platform': 'fritz', - 'previous_unique_id': None, - 'suggested_object_id': None, - 'supported_features': 0, - 'translation_key': 'cpu_temperature', - 'unique_id': '1C:ED:6F:12:34:11-cpu_temperature', - 'unit_of_measurement': , - }) -# --- -# name: test_sensor_setup[sensor.mock_title_cpu_temperature-state] - StateSnapshot({ - 'attributes': ReadOnlyDict({ - 'device_class': 'temperature', - 'friendly_name': 'Mock Title CPU temperature', - 'state_class': , - 'unit_of_measurement': , - }), - 'context': , - 'entity_id': 'sensor.mock_title_cpu_temperature', - 'last_changed': , - 'last_reported': , - 'last_updated': , - 'state': '69', - }) -# --- diff --git a/tests/components/fritz/test_config_flow.py b/tests/components/fritz/test_config_flow.py index f790489c3413..809eea7815e5 100644 --- a/tests/components/fritz/test_config_flow.py +++ b/tests/components/fritz/test_config_flow.py @@ -727,7 +727,7 @@ async def test_ssdp_exception(hass: HomeAssistant) -> None: assert result["step_id"] == "confirm" -async def test_options_flow(hass: HomeAssistant) -> None: +async def test_options_flow(hass: HomeAssistant, fc_class_mock) -> None: """Test options flow.""" mock_config = MockConfigEntry(domain=DOMAIN, data=MOCK_USER_DATA) diff --git a/tests/components/fritz/test_diagnostics.py b/tests/components/fritz/test_diagnostics.py index 84b06a3dd4a9..bd8bc33d0964 100644 --- a/tests/components/fritz/test_diagnostics.py +++ b/tests/components/fritz/test_diagnostics.py @@ -20,6 +20,7 @@ async def test_entry_diagnostics( hass_client: ClientSessionGenerator, fc_class_mock, fh_class_mock, + fs_class_mock, snapshot: SnapshotAssertion, ) -> None: """Test config entry diagnostics.""" diff --git a/tests/components/fritz/test_sensor.py b/tests/components/fritz/test_sensor.py index 4b352ccb8da5..792a5093a223 100644 --- a/tests/components/fritz/test_sensor.py +++ b/tests/components/fritz/test_sensor.py @@ -28,6 +28,7 @@ async def test_sensor_setup( entity_registry: er.EntityRegistry, fc_class_mock, fh_class_mock, + fs_class_mock, snapshot: SnapshotAssertion, ) -> None: """Test setup of Fritz!Tools sensors."""