Files
ha-core/tests/components/jewish_calendar/test_diagnostics.py
Tsvi Mostovicz b71870aba3 Jewish calendar: move value calculation to entity description (1/3) (#144272)
* Move make_zmanim() method to entity

* Move enum values to setup

* Create a Jewish Calendar Sensor Description

* Hold a single variable for the runtime data in the entity

* Move value calculation to sensor description

* Use a base class to keep timestamp sensor inheritance

* Move attr to entity description as well

* Move options to entity description as well

* Fix tests after merge

* Put multiline in parentheses

* Fix diagnostics tests
2025-05-20 19:01:24 +02:00

32 lines
976 B
Python

"""Tests for the diagnostics data provided by the Jewish Calendar integration."""
import datetime as dt
import pytest
from syrupy.assertion import SnapshotAssertion
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.parametrize(
("location_data"), ["Jerusalem", "New York", None], indirect=True
)
@pytest.mark.parametrize("test_time", [dt.datetime(2025, 5, 19)], indirect=True)
@pytest.mark.usefixtures("setup_at_time")
async def test_diagnostics(
hass: HomeAssistant,
config_entry: MockConfigEntry,
hass_client: ClientSessionGenerator,
snapshot: SnapshotAssertion,
) -> None:
"""Test diagnostics with different locations."""
diagnostics_data = await get_diagnostics_for_config_entry(
hass, hass_client, config_entry
)
assert diagnostics_data == snapshot