core/tests/components/otp/test_sensor.py

24 lines
638 B
Python
Raw Normal View History

"""Tests for the One-Time Password (OTP) Sensors."""
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.core import HomeAssistant
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