Skip to content

Commit

Permalink
hassfest errors
Browse files Browse the repository at this point in the history
  • Loading branch information
bruxy70 committed Nov 6, 2023
1 parent a7fff1a commit 65ae890
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion custom_components/holidays/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import holidays # pylint: disable=import-self
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.config_validation import (PLATFORM_SCHEMA,
PLATFORM_SCHEMA_BASE)
from homeassistant.helpers.typing import ConfigType

from . import const
Expand All @@ -17,7 +19,6 @@

_LOGGER = logging.getLogger(__name__)


async def async_setup(hass: HomeAssistant, _: ConfigType) -> bool:
"""Set up the platform - inicialize data structure."""
hass.data.setdefault(const.DOMAIN, {})
Expand Down
6 changes: 4 additions & 2 deletions test/test_calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ async def test_se(hass: HomeAssistant) -> None:

config_entry: MockConfigEntry = MockConfigEntry(
domain=const.DOMAIN,
options={"country": "SE", "languages":"sv"},
options={"country": "SE", "languages": "sv"},
title="SE Holidays",
)
config_entry.add_to_hass(hass)
Expand All @@ -85,7 +85,9 @@ async def test_se(hass: HomeAssistant) -> None:
holidays = se_holidays.attributes["holidays"]
len_holidays = len(holidays)
assert state == "40", ERROR_STATE.format(9, state)
assert next_holiday == "Långfredagen", ERROR_NAME.format("Långfredagen", next_holiday)
assert next_holiday == "Långfredagen", ERROR_NAME.format(
"Långfredagen", next_holiday
)
assert next_date.date() == date(2020, 4, 10), ERROR_DATE.format(
"April 10", next_date.date()
)
Expand Down

0 comments on commit 65ae890

Please sign in to comment.