core/tests/components/autarco/test_sensor.py
Klaas Schoute fce68018b7
Add Autarco integration (#121600)
* Init Autarco integration

* Add integration code with tests

* Update every 5 minutes

* Process all feedback from Joost

* Bump lib to v2.0.0

* Add more then one site if present

* Fix issue with entity translation

* Update the test for sensor entities

* Fix round two based on feedback from Joost

* Add autarco to strict typing

* Update tests/components/autarco/test_config_flow.py

* Update tests/components/autarco/test_config_flow.py

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-07-10 23:05:31 +02:00

28 lines
866 B
Python

"""Test the sensor provided by the Autarco integration."""
from unittest.mock import MagicMock, patch
from syrupy import SnapshotAssertion
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from . import setup_integration
from tests.common import MockConfigEntry, snapshot_platform
async def test_solar_sensors(
hass: HomeAssistant,
mock_autarco_client: MagicMock,
mock_config_entry: MockConfigEntry,
entity_registry: er.EntityRegistry,
snapshot: SnapshotAssertion,
) -> None:
"""Test the Autarco - Solar sensor."""
with patch("homeassistant.components.autarco.PLATFORMS", [Platform.SENSOR]):
await setup_integration(hass, mock_config_entry)
await snapshot_platform(hass, entity_registry, snapshot, mock_config_entry.entry_id)