2024-06-20 08:03:29 +00:00
|
|
|
"""Tests for the One-Time Password (OTP) Sensors."""
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
from syrupy.assertion import SnapshotAssertion
|
|
|
|
|
2024-12-30 10:12:16 +00:00
|
|
|
from homeassistant.core import HomeAssistant
|
2024-06-20 08:03:29 +00:00
|
|
|
|
|
|
|
from tests.common import MockConfigEntry
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.usefixtures("mock_pyotp")
|
|
|
|
async def test_setup(
|
|
|
|
hass: HomeAssistant,
|
|
|
|
otp_config_entry: MockConfigEntry,
|
|
|
|
snapshot: SnapshotAssertion,
|
|
|
|
) -> None:
|
|
|
|
"""Test setup of ista EcoTrend sensor platform."""
|
|
|
|
|
|
|
|
otp_config_entry.add_to_hass(hass)
|
|
|
|
await hass.config_entries.async_setup(otp_config_entry.entry_id)
|
|
|
|
await hass.async_block_till_done()
|
|
|
|
|
|
|
|
assert hass.states.get("sensor.otp_sensor") == snapshot
|