mirror of
https://github.com/home-assistant/core.git
synced 2026-04-02 08:26:41 +01:00
33 lines
1.0 KiB
Python
33 lines
1.0 KiB
Python
"""Tests for the diagnostics data provided by the Opower integration."""
|
|
|
|
from unittest.mock import AsyncMock
|
|
|
|
import pytest
|
|
from syrupy.assertion import SnapshotAssertion
|
|
from syrupy.filters import props
|
|
|
|
from homeassistant.components.recorder import Recorder
|
|
from homeassistant.core import HomeAssistant
|
|
|
|
from tests.common import MockConfigEntry
|
|
from tests.components.diagnostics import get_diagnostics_for_config_entry
|
|
from tests.typing import ClientSessionGenerator
|
|
|
|
|
|
@pytest.mark.freeze_time("2026-03-07T23:00:00+00:00")
|
|
async def test_diagnostics(
|
|
recorder_mock: Recorder,
|
|
hass: HomeAssistant,
|
|
hass_client: ClientSessionGenerator,
|
|
mock_config_entry: MockConfigEntry,
|
|
mock_opower_api: AsyncMock,
|
|
snapshot: SnapshotAssertion,
|
|
) -> None:
|
|
"""Test diagnostics."""
|
|
await hass.config_entries.async_setup(mock_config_entry.entry_id)
|
|
await hass.async_block_till_done()
|
|
|
|
assert await get_diagnostics_for_config_entry(
|
|
hass, hass_client, mock_config_entry
|
|
) == snapshot(exclude=props("entry_id"))
|