repo stringlengths 7 90 | file_url stringlengths 81 315 | file_path stringlengths 4 228 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:38:15 2026-01-05 02:33:18 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/hassfest/conftest.py | tests/hassfest/conftest.py | """Fixtures for hassfest tests."""
from pathlib import Path
from unittest.mock import patch
import pytest
from script.hassfest.model import Config, Integration
@pytest.fixture
def config():
"""Fixture for hassfest Config."""
return Config(
root=Path(".").absolute(),
specific_integrations=No... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/hassfest/test_conditions.py | tests/hassfest/test_conditions.py | """Tests for hassfest conditions."""
import io
import json
from pathlib import Path
from unittest.mock import patch
import pytest
from homeassistant.util.yaml.loader import parse_yaml
from script.hassfest import conditions
from script.hassfest.model import Config
from . import get_integration
CONDITION_DESCRIPTION... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/hassfest/test_version.py | tests/hassfest/test_version.py | """Tests for hassfest version."""
from pathlib import Path
import pytest
import voluptuous as vol
from script.hassfest.manifest import (
CUSTOM_INTEGRATION_MANIFEST_SCHEMA,
validate_version,
)
from script.hassfest.model import Config, Integration
@pytest.fixture
def integration():
"""Fixture for hassfe... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/hassfest/test_translations.py | tests/hassfest/test_translations.py | """Tests for hassfest translations."""
import pytest
import voluptuous as vol
from script.hassfest import translations
def test_string_with_no_placeholders_in_single_quotes() -> None:
"""Test string with no placeholders in single quotes."""
schema = vol.Schema(translations.string_no_single_quoted_placeholde... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/hassfest/test_triggers.py | tests/hassfest/test_triggers.py | """Tests for hassfest triggers."""
import io
import json
from pathlib import Path
from unittest.mock import patch
import pytest
from homeassistant.util.yaml.loader import parse_yaml
from script.hassfest import triggers
from script.hassfest.model import Config
from . import get_integration
TRIGGER_DESCRIPTION_FILEN... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/hassfest/__init__.py | tests/hassfest/__init__.py | """Tests for hassfest."""
from pathlib import Path
from script.hassfest.model import Config, Integration
def get_integration(domain: str, config: Config):
"""Helper function for creating hassfest integration model instances."""
return Integration(
Path(domain),
_config=config,
_manif... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_llm.py | tests/helpers/test_llm.py | """Tests for the llm helpers."""
from datetime import timedelta
from decimal import Decimal
from unittest.mock import patch
import pytest
import voluptuous as vol
from homeassistant.components import calendar, todo
from homeassistant.components.homeassistant.exposed_entities import async_expose_entity
from homeassis... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | true |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_debounce.py | tests/helpers/test_debounce.py | """Tests for debounce."""
import asyncio
from datetime import timedelta
import logging
from unittest.mock import AsyncMock, Mock
import weakref
import pytest
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers import debounce
from homeassistant.util.dt import utcnow
from tests.common i... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_category_registry.py | tests/helpers/test_category_registry.py | """Tests for the category registry."""
from datetime import datetime
from functools import partial
import re
from typing import Any
from freezegun.api import FrozenDateTimeFactory
import pytest
from homeassistant.core import HomeAssistant
from homeassistant.helpers import category_registry as cr
from homeassistant.u... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_update_coordinator.py | tests/helpers/test_update_coordinator.py | """Tests for the update coordinator."""
import asyncio
from datetime import datetime, timedelta
import logging
from unittest.mock import AsyncMock, Mock, patch
import urllib.error
import weakref
import aiohttp
from freezegun.api import FrozenDateTimeFactory
import pytest
import requests
from homeassistant import con... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | true |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_target.py | tests/helpers/test_target.py | """Test service helpers."""
import pytest
from homeassistant.components.group import Group
from homeassistant.const import (
ATTR_AREA_ID,
ATTR_DEVICE_ID,
ATTR_ENTITY_ID,
ATTR_FLOOR_ID,
ATTR_LABEL_ID,
ENTITY_MATCH_NONE,
STATE_OFF,
STATE_ON,
EntityCategory,
)
from homeassistant.core... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_instance_id.py | tests/helpers/test_instance_id.py | """Tests for instance ID helper."""
from json import JSONDecodeError
from typing import Any
from unittest.mock import patch
import pytest
from homeassistant.core import HomeAssistant
from homeassistant.helpers import instance_id
async def test_get_id_empty(hass: HomeAssistant, hass_storage: dict[str, Any]) -> None... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_registry.py | tests/helpers/test_registry.py | """Tests for the registry."""
from typing import Any
from freezegun.api import FrozenDateTimeFactory
import pytest
from homeassistant.core import CoreState, HomeAssistant
from homeassistant.helpers import storage
from homeassistant.helpers.registry import SAVE_DELAY, SAVE_DELAY_LONG, BaseRegistry
from tests.common ... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_device_registry.py | tests/helpers/test_device_registry.py | """Tests for the Device Registry."""
from collections.abc import Iterable
from contextlib import AbstractContextManager, nullcontext
from datetime import datetime
from functools import partial
import time
from typing import Any
from unittest.mock import ANY, patch
import attr
from freezegun.api import FrozenDateTimeF... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | true |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_trigger_template_entity.py | tests/helpers/test_trigger_template_entity.py | """Test template trigger entity."""
from typing import Any
import pytest
from homeassistant.components.sensor import SensorDeviceClass
from homeassistant.components.sensor.helpers import ( # pylint: disable=hass-component-root-import
async_parse_date_datetime,
)
from homeassistant.const import (
CONF_DEVICE... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_deprecation.py | tests/helpers/test_deprecation.py | """Test deprecation helpers."""
from enum import StrEnum
import logging
import sys
from typing import Any
from unittest.mock import MagicMock, Mock, patch
import pytest
from homeassistant.core import HomeAssistant
from homeassistant.helpers.deprecation import (
DeprecatedAlias,
DeprecatedConstant,
Deprec... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_config_entry_flow.py | tests/helpers/test_config_entry_flow.py | """Tests for the Config Entry Flow helper."""
import asyncio
from collections.abc import Callable, Generator
from contextlib import contextmanager
from unittest.mock import Mock, PropertyMock, patch
import pytest
from homeassistant import config_entries, data_entry_flow, setup
from homeassistant.core import HomeAssi... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_entity_values.py | tests/helpers/test_entity_values.py | """Test the entity values helper."""
from collections import OrderedDict
from homeassistant.helpers.entity_values import EntityValues as EV
ent = "test.test"
def test_override_single_value() -> None:
"""Test values with exact match."""
store = EV({ent: {"key": "value"}})
store.get.cache_clear()
ass... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_entityfilter.py | tests/helpers/test_entityfilter.py | """The tests for the EntityFilter component."""
from homeassistant.helpers.entityfilter import (
FILTER_SCHEMA,
INCLUDE_EXCLUDE_FILTER_SCHEMA,
EntityFilter,
generate_filter,
)
def test_no_filters_case_1() -> None:
"""If include and exclude not included, pass everything."""
incl_dom = {}
i... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_system_info.py | tests/helpers/test_system_info.py | """Tests for the system info helper."""
import json
import os
from unittest.mock import patch
import pytest
from homeassistant.components import hassio
from homeassistant.const import __version__ as current_version
from homeassistant.core import HomeAssistant
from homeassistant.helpers.system_info import async_get_s... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_aiohttp_client.py | tests/helpers/test_aiohttp_client.py | """Test the aiohttp client helper."""
import socket
from unittest.mock import Mock, patch
import aiohttp
from aiohttp.test_utils import TestClient
import pytest
from homeassistant.components.mjpeg import (
CONF_MJPEG_URL,
CONF_STILL_IMAGE_URL,
DOMAIN as MJPEG_DOMAIN,
)
from homeassistant.const import (
... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_device.py | tests/helpers/test_device.py | """Tests for the Device Utils."""
import pytest
import voluptuous as vol
from homeassistant.core import HomeAssistant
from homeassistant.helpers import device_registry as dr, entity_registry as er
from homeassistant.helpers.device import (
async_device_info_to_link_from_device_id,
async_device_info_to_link_fr... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_service.py | tests/helpers/test_service.py | """Test service helpers."""
import asyncio
from collections.abc import Callable, Iterable
from copy import deepcopy
import dataclasses
import io
import threading
from typing import Any
from unittest.mock import AsyncMock, Mock, patch
import pytest
from pytest_unordered import unordered
import voluptuous as vol
# To ... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | true |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_integration_platform.py | tests/helpers/test_integration_platform.py | """Test integration platform helpers."""
from collections.abc import Callable
from types import ModuleType
from typing import Any
from unittest.mock import Mock, patch
import pytest
from homeassistant import loader
from homeassistant.const import EVENT_COMPONENT_LOADED
from homeassistant.core import HomeAssistant, c... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_selector.py | tests/helpers/test_selector.py | """Test selectors."""
from collections.abc import Callable, Iterable
from contextlib import AbstractContextManager, nullcontext as does_not_raise
from enum import Enum
from typing import Any
import pytest
from syrupy.assertion import SnapshotAssertion
import voluptuous as vol
from homeassistant.helpers import select... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | true |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_importlib.py | tests/helpers/test_importlib.py | """Tests for the importlib helper."""
import time
from typing import Any
from unittest.mock import patch
import pytest
from homeassistant.core import HomeAssistant
from homeassistant.helpers import importlib
from tests.common import MockModule
async def test_async_import_module(hass: HomeAssistant) -> None:
"... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_service_info.py | tests/helpers/test_service_info.py | """Test service_info helpers."""
import pytest
from homeassistant.helpers.service_info.dhcp import DhcpServiceInfo
from homeassistant.helpers.service_info.esphome import ESPHomeServiceInfo
# Ensure that incorrectly formatted mac addresses are rejected, even
# on a constant outside of a test
try:
_ = DhcpServiceI... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_reload.py | tests/helpers/test_reload.py | """Tests for the reload helper."""
import logging
from unittest.mock import AsyncMock, Mock, patch
import pytest
import voluptuous as vol
from homeassistant import config
from homeassistant.const import SERVICE_RELOAD
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigValidationE... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_temperature.py | tests/helpers/test_temperature.py | """Tests Home Assistant temperature helpers."""
import pytest
from homeassistant.const import (
PRECISION_HALVES,
PRECISION_TENTHS,
PRECISION_WHOLE,
UnitOfTemperature,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers.temperature import display_temp
TEMP = 24.636626
def test... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_schema_config_entry_flow.py | tests/helpers/test_schema_config_entry_flow.py | """Tests for the schema based data entry flows."""
from __future__ import annotations
from collections.abc import Mapping
from typing import Any
from unittest.mock import AsyncMock, patch
import pytest
import voluptuous as vol
from homeassistant import config_entries, data_entry_flow
from homeassistant.core import ... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_entity.py | tests/helpers/test_entity.py | """Test the entity helper."""
import asyncio
from collections.abc import Iterable
import dataclasses
from datetime import timedelta
import logging
import threading
from typing import Any
from unittest.mock import MagicMock, PropertyMock, patch
from freezegun.api import FrozenDateTimeFactory
from propcache.api import ... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | true |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_dispatcher.py | tests/helpers/test_dispatcher.py | """Test dispatcher helpers."""
from functools import partial
import pytest
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.dispatcher import (
async_dispatcher_connect,
async_dispatcher_send,
)
from homeassistant.util.signal_type import SignalType, SignalTypeFormat
async d... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_chat_session.py | tests/helpers/test_chat_session.py | """Test the chat session helper."""
from collections.abc import Generator
from datetime import timedelta
from unittest.mock import Mock, patch
import pytest
from homeassistant.core import HomeAssistant
from homeassistant.helpers import chat_session
from homeassistant.util import dt as dt_util, ulid as ulid_util
fro... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_json.py | tests/helpers/test_json.py | """Test Home Assistant remote methods and classes."""
import datetime
from functools import partial
import json
import math
import os
from pathlib import Path
import time
from typing import Any, NamedTuple
from unittest.mock import Mock, patch
import pytest
from homeassistant.core import Event, HomeAssistant, State
... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_start.py | tests/helpers/test_start.py | """Test starting HA helpers."""
import pytest
from homeassistant.const import EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STARTED
from homeassistant.core import CoreState, HomeAssistant, callback
from homeassistant.helpers import start
async def test_at_start_when_running_awaitable(hass: HomeAssistant) -> None:
... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_icon.py | tests/helpers/test_icon.py | """Test Home Assistant icon util methods."""
import pathlib
from unittest.mock import Mock, patch
import pytest
from homeassistant.core import HomeAssistant
from homeassistant.helpers import icon
from homeassistant.loader import IntegrationNotFound
from homeassistant.setup import async_setup_component
def test_bat... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_helper_integration.py | tests/helpers/test_helper_integration.py | """Tests for the helper entity helpers."""
from collections.abc import Generator
from unittest.mock import AsyncMock, Mock
import pytest
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import Event, HomeAssistant, callback
from homeassistant.helpers import device_registry as dr, entity_r... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_floor_registry.py | tests/helpers/test_floor_registry.py | """Tests for the floor registry."""
from datetime import UTC, datetime
from functools import partial
import re
from typing import Any
from freezegun.api import FrozenDateTimeFactory
import pytest
from homeassistant.core import HomeAssistant
from homeassistant.helpers import area_registry as ar, floor_registry as fr
... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_translation.py | tests/helpers/test_translation.py | """Test the translation helper."""
import asyncio
import pathlib
from typing import Any
from unittest.mock import Mock, call, patch
import pytest
from homeassistant import loader
from homeassistant.const import EVENT_CORE_CONFIG_UPDATE
from homeassistant.core import HomeAssistant
from homeassistant.helpers import tr... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_config_validation.py | tests/helpers/test_config_validation.py | """Test config validators."""
from collections import OrderedDict
from datetime import date, datetime, timedelta
import enum
from functools import partial
import logging
import os
import re
from socket import _GLOBAL_DEFAULT_TIMEOUT
import threading
from typing import Any
from unittest.mock import ANY, Mock, patch
imp... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | true |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_label_registry.py | tests/helpers/test_label_registry.py | """Tests for the Label Registry."""
from datetime import datetime
from functools import partial
import re
from typing import Any
from freezegun.api import FrozenDateTimeFactory
import pytest
from homeassistant.core import HomeAssistant
from homeassistant.helpers import (
device_registry as dr,
entity_registr... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_frame.py | tests/helpers/test_frame.py | """Test the frame helper."""
from contextlib import AbstractContextManager, nullcontext as does_not_raise
from typing import Any
from unittest.mock import ANY, Mock, patch
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.core import HomeAssistant
from homeassistant.helpers import frame... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_state.py | tests/helpers/test_state.py | """Test state helpers."""
import asyncio
from unittest.mock import patch
import pytest
from homeassistant.components.lock import LockState
from homeassistant.components.sun import STATE_ABOVE_HORIZON, STATE_BELOW_HORIZON
from homeassistant.const import (
SERVICE_TURN_OFF,
SERVICE_TURN_ON,
STATE_CLOSED,
... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_location.py | tests/helpers/test_location.py | """Tests Home Assistant location helpers."""
from homeassistant.const import ATTR_FRIENDLY_NAME, ATTR_LATITUDE, ATTR_LONGITUDE
from homeassistant.core import HomeAssistant, State
from homeassistant.helpers import location
def test_has_location_with_invalid_states() -> None:
"""Set up the tests."""
for state ... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_significant_change.py | tests/helpers/test_significant_change.py | """Test significant change helper."""
from types import MappingProxyType
from typing import Any
import pytest
from homeassistant.components.sensor import SensorDeviceClass
from homeassistant.const import ATTR_DEVICE_CLASS, STATE_UNAVAILABLE, STATE_UNKNOWN
from homeassistant.core import HomeAssistant, State
from home... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_discovery.py | tests/helpers/test_discovery.py | """Test discovery helpers."""
from unittest.mock import patch
import pytest
from homeassistant import setup
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers import discovery
from homeassistant.helpers.dispatcher import async_dispatcher_send
fr... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_condition.py | tests/helpers/test_condition.py | """Test the condition helper."""
from datetime import timedelta
import io
from typing import Any
from unittest.mock import AsyncMock, Mock, patch
from freezegun import freeze_time
import pytest
from pytest_unordered import unordered
import voluptuous as vol
from homeassistant.components.device_automation import (
... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | true |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_collection.py | tests/helpers/test_collection.py | """Tests for the collection helper."""
from __future__ import annotations
from datetime import timedelta
import logging
from freezegun.api import FrozenDateTimeFactory
import pytest
import voluptuous as vol
from homeassistant.core import HomeAssistant
from homeassistant.helpers import (
collection,
entity_c... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_intent.py | tests/helpers/test_intent.py | """Tests for the intent helpers."""
import asyncio
from unittest.mock import MagicMock, patch
import pytest
import voluptuous as vol
from homeassistant.components import light, switch
from homeassistant.components.homeassistant.exposed_entities import async_expose_entity
from homeassistant.const import (
ATTR_DE... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_redact.py | tests/helpers/test_redact.py | """Test the data redation helper."""
from homeassistant.helpers.redact import REDACTED, async_redact_data, partial_redact
def test_redact() -> None:
"""Test the async_redact_data helper."""
data = {
"key1": "value1",
"key2": ["value2_a", "value2_b"],
"key3": [["value_3a", "value_3b"],... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_normalized_name_base_registry.py | tests/helpers/test_normalized_name_base_registry.py | """Tests for the normalized name base registry helper."""
import pytest
from homeassistant.helpers.normalized_name_base_registry import (
NormalizedNameBaseRegistryEntry,
NormalizedNameBaseRegistryItems,
normalize_name,
)
@pytest.fixture
def registry_items() -> NormalizedNameBaseRegistryItems:
"""Fi... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_entity_registry.py | tests/helpers/test_entity_registry.py | """Tests for the Entity Registry."""
from datetime import datetime, timedelta
from functools import partial
from typing import Any
from unittest.mock import patch
import attr
from freezegun.api import FrozenDateTimeFactory
import pytest
import voluptuous as vol
from homeassistant import config_entries
from homeassis... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | true |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_check_config.py | tests/helpers/test_check_config.py | """Test check_config helper."""
import logging
from unittest.mock import Mock, patch
import pytest
import voluptuous as vol
from homeassistant.config import YAML_CONFIG_FILE
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers import config_v... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_restore_state.py | tests/helpers/test_restore_state.py | """The tests for the Restore component."""
from collections.abc import Coroutine
from datetime import datetime, timedelta
import logging
from typing import Any
from unittest.mock import Mock, patch
from homeassistant.const import EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP
from homeassistant.core import CoreS... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_script.py | tests/helpers/test_script.py | """The tests for the Script component."""
import asyncio
from contextlib import contextmanager
from datetime import timedelta
from functools import reduce
import logging
import operator
from types import MappingProxyType
from unittest import mock
from unittest.mock import ANY, AsyncMock, MagicMock, patch
from freezeg... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | true |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_automation.py | tests/helpers/test_automation.py | """Test automation helpers."""
import pytest
import voluptuous as vol
from homeassistant.helpers.automation import (
get_absolute_description_key,
get_relative_description_key,
move_options_fields_to_top_level,
move_top_level_schema_fields_to_options,
)
@pytest.mark.parametrize(
("relative_key",... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_ratelimit.py | tests/helpers/test_ratelimit.py | """Tests for ratelimit."""
import asyncio
import time
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers import ratelimit
async def test_hit(hass: HomeAssistant) -> None:
"""Test hitting the rate limit."""
refresh_called = False
@callback
def _refresh():
nonl... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_group.py | tests/helpers/test_group.py | """Test the group helper."""
from homeassistant.const import ATTR_ENTITY_ID, STATE_OFF, STATE_ON
from homeassistant.core import HomeAssistant
from homeassistant.helpers import group
async def test_expand_entity_ids(hass: HomeAssistant) -> None:
"""Test expand_entity_ids method."""
hass.states.async_set("ligh... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_area_registry.py | tests/helpers/test_area_registry.py | """Tests for the Area Registry."""
from datetime import UTC, datetime, timedelta
from functools import partial
from typing import Any
from freezegun.api import FrozenDateTimeFactory
import pytest
from homeassistant.components.sensor import SensorDeviceClass
from homeassistant.const import (
ATTR_DEVICE_CLASS,
... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_script_variables.py | tests/helpers/test_script_variables.py | """Test script variables."""
import pytest
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import TemplateError
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.script_variables import ScriptRunVariables, ScriptVariables
async def test_static_vars() -> ... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_sun.py | tests/helpers/test_sun.py | """The tests for the Sun helpers."""
from datetime import datetime, timedelta
from astral import LocationInfo
import astral.sun
from freezegun import freeze_time
import pytest
from homeassistant.const import SUN_EVENT_SUNRISE, SUN_EVENT_SUNSET
from homeassistant.core import HomeAssistant
from homeassistant.helpers i... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/__init__.py | tests/helpers/__init__.py | """The tests for the helpers."""
| python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_network.py | tests/helpers/test_network.py | """Test network helper."""
from unittest.mock import Mock, patch
from aiohttp import hdrs
from multidict import CIMultiDict, CIMultiDictProxy
import pytest
from yarl import URL
from homeassistant.components import cloud
from homeassistant.core import HomeAssistant
from homeassistant.core_config import async_process_... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | true |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_httpx_client.py | tests/helpers/test_httpx_client.py | """Test the httpx client helper."""
from unittest.mock import Mock, patch
import httpx
import pytest
from homeassistant.const import EVENT_HOMEASSISTANT_CLOSE
from homeassistant.core import HomeAssistant
from homeassistant.helpers import httpx_client as client
from tests.common import MockModule, extract_stack_to_f... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_entity_platform.py | tests/helpers/test_entity_platform.py | """Tests for the EntityPlatform helper."""
import asyncio
from collections.abc import Iterable
from datetime import timedelta
import logging
import types
from typing import Any
from unittest.mock import ANY, AsyncMock, Mock, patch
import pytest
from syrupy.assertion import SnapshotAssertion
import voluptuous as vol
... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | true |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_recorder.py | tests/helpers/test_recorder.py | """The tests for the recorder helpers."""
from unittest.mock import patch
from homeassistant.core import HomeAssistant
from homeassistant.helpers import recorder
from tests.typing import RecorderInstanceGenerator
async def test_async_migration_in_progress(
async_setup_recorder_instance: RecorderInstanceGenerat... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_event.py | tests/helpers/test_event.py | """Test event helpers."""
import asyncio
from collections.abc import Callable
import contextlib
from datetime import date, datetime, timedelta
from unittest.mock import patch
from astral import LocationInfo
import astral.sun
from freezegun import freeze_time
from freezegun.api import FrozenDateTimeFactory
import jinj... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | true |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_entity_component.py | tests/helpers/test_entity_component.py | """The tests for the Entity component helper."""
from collections import OrderedDict
from datetime import timedelta
import logging
import re
from unittest.mock import AsyncMock, Mock, patch
from freezegun import freeze_time
import pytest
import voluptuous as vol
from homeassistant.const import (
ENTITY_MATCH_ALL... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_config_entry_oauth2_flow.py | tests/helpers/test_config_entry_oauth2_flow.py | """Tests for the Somfy config flow."""
from collections.abc import AsyncGenerator, Generator
from http import HTTPStatus
import logging
import time
from typing import Any
from unittest.mock import AsyncMock, patch
import aiohttp
import pytest
from homeassistant import config_entries, data_entry_flow, setup
from home... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | true |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_discovery_flow.py | tests/helpers/test_discovery_flow.py | """Test the discovery flow helper."""
from collections.abc import Generator
from unittest.mock import AsyncMock, call, patch
import pytest
from homeassistant import config_entries
from homeassistant.const import EVENT_HOMEASSISTANT_STARTED
from homeassistant.core import CoreState, HomeAssistant
from homeassistant.he... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_singleton.py | tests/helpers/test_singleton.py | """Test singleton helper."""
from typing import Any
from unittest.mock import Mock
import pytest
from homeassistant.core import HomeAssistant
from homeassistant.helpers import singleton
@pytest.fixture
def mock_hass():
"""Mock hass fixture."""
return Mock(data={})
@pytest.mark.parametrize("result", [obje... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_storage_remove.py | tests/helpers/test_storage_remove.py | """Tests for the storage helper with minimal mocking."""
from datetime import timedelta
import os
from unittest.mock import patch
import py
from homeassistant.helpers import storage
from homeassistant.util import dt as dt_util
from tests.common import async_fire_time_changed, async_test_home_assistant
async def t... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_storage.py | tests/helpers/test_storage.py | """Tests for the storage helper."""
import asyncio
from datetime import timedelta
import json
import os
from pathlib import Path
import threading
from typing import Any, NamedTuple
from unittest.mock import Mock, patch
from freezegun.api import FrozenDateTimeFactory
import py
import pytest
from homeassistant.const i... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | true |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_trigger.py | tests/helpers/test_trigger.py | """The tests for the trigger helper."""
from contextlib import AbstractContextManager, nullcontext as does_not_raise
import io
from typing import Any
from unittest.mock import ANY, AsyncMock, MagicMock, Mock, call, patch
import pytest
from pytest_unordered import unordered
import voluptuous as vol
from homeassistant... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | true |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/test_issue_registry.py | tests/helpers/test_issue_registry.py | """Test the repairs websocket API."""
from functools import partial
from typing import Any
import pytest
from homeassistant.core import HomeAssistant
from homeassistant.helpers import issue_registry as ir
from tests.common import async_capture_events, flush_store
async def test_load_save_issues(hass: HomeAssistan... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/template/test_render_info.py | tests/helpers/template/test_render_info.py | """Test template render information tracking for Home Assistant."""
from __future__ import annotations
import pytest
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import TemplateError
from homeassistant.helpers import template
from homeassistant.helpers.template.render_info import (
... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/template/test_context.py | tests/helpers/template/test_context.py | """Test template context management for Home Assistant."""
from __future__ import annotations
import jinja2
from homeassistant.helpers.template.context import (
TemplateContextManager,
render_with_context,
template_context_manager,
template_cv,
)
def test_template_context_manager() -> None:
"""... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/template/helpers.py | tests/helpers/template/helpers.py | """Helpers for tests around template rendering."""
from __future__ import annotations
from collections.abc import Iterable
from typing import Any
from homeassistant.core import HomeAssistant
from homeassistant.helpers import template
from homeassistant.helpers.typing import TemplateVarsType
def render(
hass: H... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/template/__init__.py | tests/helpers/template/__init__.py | """Tests for Home Assistant template engine."""
| python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/template/test_init.py | tests/helpers/template/test_init.py | """Test Home Assistant template helper methods."""
from __future__ import annotations
from collections.abc import Iterable
from datetime import datetime, timedelta
import json
import logging
import math
import random
from unittest.mock import patch
from freezegun import freeze_time
import orjson
import pytest
from s... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | true |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/template/test_helpers.py | tests/helpers/template/test_helpers.py | """Test template helper functions."""
import pytest
from homeassistant.core import HomeAssistant
from homeassistant.helpers import (
area_registry as ar,
device_registry as dr,
entity_registry as er,
)
from homeassistant.helpers.template.helpers import raise_no_default, resolve_area_id
from tests.common ... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/template/extensions/test_string.py | tests/helpers/template/extensions/test_string.py | """Test string template extension."""
from __future__ import annotations
from homeassistant.core import HomeAssistant
from tests.helpers.template.helpers import render
def test_ordinal(hass: HomeAssistant) -> None:
"""Test the ordinal filter."""
tests = [
(1, "1st"),
(2, "2nd"),
(3,... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/template/extensions/test_datetime.py | tests/helpers/template/extensions/test_datetime.py | """Test datetime template functions."""
from __future__ import annotations
from datetime import datetime
from types import MappingProxyType
from typing import Any
from unittest.mock import patch
from freezegun import freeze_time
import pytest
from homeassistant.core import HomeAssistant
from homeassistant.exception... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/template/extensions/test_areas.py | tests/helpers/template/extensions/test_areas.py | """Test area template functions."""
from __future__ import annotations
from homeassistant.core import HomeAssistant
from homeassistant.helpers import (
area_registry as ar,
device_registry as dr,
entity_registry as er,
)
from tests.common import MockConfigEntry
from tests.helpers.template.helpers import ... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/template/extensions/test_issues.py | tests/helpers/template/extensions/test_issues.py | """Test issue template functions."""
from __future__ import annotations
from homeassistant.core import HomeAssistant
from homeassistant.helpers import issue_registry as ir
from homeassistant.util import dt as dt_util
from tests.helpers.template.helpers import assert_result_info, render_to_info
async def test_issue... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/template/extensions/test_base.py | tests/helpers/template/extensions/test_base.py | """Test base template extension."""
from __future__ import annotations
import pytest
from homeassistant.exceptions import TemplateError
from homeassistant.helpers.template import TemplateEnvironment
from homeassistant.helpers.template.extensions.base import (
BaseTemplateExtension,
TemplateFunction,
)
def ... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/template/extensions/test_math.py | tests/helpers/template/extensions/test_math.py | """Test mathematical and statistical functions for Home Assistant templates."""
from __future__ import annotations
import math
import pytest
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import TemplateError
from homeassistant.helpers.template.extensions import MathExtension
from tests... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/template/extensions/test_labels.py | tests/helpers/template/extensions/test_labels.py | """Test label template functions."""
from __future__ import annotations
from homeassistant.core import HomeAssistant
from homeassistant.helpers import (
area_registry as ar,
device_registry as dr,
entity_registry as er,
label_registry as lr,
)
from tests.common import MockConfigEntry
from tests.helpe... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/template/extensions/test_base64.py | tests/helpers/template/extensions/test_base64.py | """Test base64 encoding and decoding functions for Home Assistant templates."""
from __future__ import annotations
import pytest
from homeassistant.core import HomeAssistant
from tests.helpers.template.helpers import render
@pytest.mark.parametrize(
("value_template", "expected"),
[
('{{ "homeassi... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/template/extensions/test_collection.py | tests/helpers/template/extensions/test_collection.py | """Test collection extension."""
from __future__ import annotations
from typing import Any
import pytest
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import TemplateError
from tests.helpers.template.helpers import render
@pytest.mark.parametrize(
("value", "expected"),
[
... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/template/extensions/test_devices.py | tests/helpers/template/extensions/test_devices.py | """Test device template functions."""
from __future__ import annotations
import pytest
from homeassistant.core import HomeAssistant
from homeassistant.helpers import device_registry as dr, entity_registry as er
from homeassistant.helpers.template import TemplateError
from tests.common import MockConfigEntry
from te... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/template/extensions/__init__.py | tests/helpers/template/extensions/__init__.py | """Tests for Home Assistant template extensions."""
| python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/template/extensions/test_floors.py | tests/helpers/template/extensions/test_floors.py | """Test floor template functions."""
from __future__ import annotations
from homeassistant.core import HomeAssistant
from homeassistant.helpers import (
area_registry as ar,
device_registry as dr,
entity_registry as er,
floor_registry as fr,
)
from tests.common import MockConfigEntry
from tests.helpe... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/template/extensions/test_regex.py | tests/helpers/template/extensions/test_regex.py | """Test regex template extension."""
from __future__ import annotations
import pytest
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import TemplateError
from tests.helpers.template.helpers import render
def test_regex_match(hass: HomeAssistant) -> None:
"""Test regex_match method.... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/helpers/template/extensions/test_crypto.py | tests/helpers/template/extensions/test_crypto.py | """Test cryptographic hash functions for Home Assistant templates."""
from __future__ import annotations
from homeassistant.core import HomeAssistant
from tests.helpers.template.helpers import render
def test_md5(hass: HomeAssistant) -> None:
"""Test the md5 function and filter."""
ha_md5 = "3d15e5c102c341... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/pylint/test_enforce_super_call.py | tests/pylint/test_enforce_super_call.py | """Tests for pylint hass_enforce_super_call plugin."""
from __future__ import annotations
from types import ModuleType
from unittest.mock import patch
import astroid
from pylint.checkers import BaseChecker
from pylint.interfaces import INFERENCE
from pylint.testutils import MessageTest
from pylint.testutils.unittest... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/pylint/test_enforce_greek_micro_char.py | tests/pylint/test_enforce_greek_micro_char.py | """Tests for pylint hass_enforce_greek_micro_char plugin."""
from __future__ import annotations
import astroid
from pylint.checkers import BaseChecker
from pylint.testutils.unittest_linter import UnittestLinter
from pylint.utils.ast_walker import ASTWalker
import pytest
from . import assert_no_messages
@pytest.mar... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/pylint/test_enforce_class_module.py | tests/pylint/test_enforce_class_module.py | """Tests for pylint hass_enforce_class_module plugin."""
from __future__ import annotations
import astroid
from pylint.checkers import BaseChecker
from pylint.interfaces import UNDEFINED
from pylint.testutils import MessageTest
from pylint.testutils.unittest_linter import UnittestLinter
from pylint.utils.ast_walker i... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/pylint/test_enforce_sorted_platforms.py | tests/pylint/test_enforce_sorted_platforms.py | """Tests for pylint hass_enforce_sorted_platforms plugin."""
from __future__ import annotations
import astroid
from pylint.checkers import BaseChecker
from pylint.interfaces import UNDEFINED
from pylint.testutils import MessageTest
from pylint.testutils.unittest_linter import UnittestLinter
from pylint.utils.ast_walk... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/pylint/test_decorator.py | tests/pylint/test_decorator.py | """Tests for pylint hass_enforce_type_hints plugin."""
from __future__ import annotations
import astroid
from pylint.checkers import BaseChecker
from pylint.interfaces import UNDEFINED
from pylint.testutils import MessageTest
from pylint.testutils.unittest_linter import UnittestLinter
from pylint.utils.ast_walker imp... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.