sample_id
stringlengths
21
196
text
stringlengths
105
936k
metadata
dict
category
stringclasses
6 values
home-assistant/core:homeassistant/components/velux/button.py
"""Support for VELUX KLF 200 gateway button.""" from __future__ import annotations from pyvlx import PyVLX, PyVLXException from homeassistant.components.button import ButtonDeviceClass, ButtonEntity from homeassistant.const import EntityCategory from homeassistant.core import HomeAssistant from homeassistant.excepti...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/velux/button.py", "license": "Apache License 2.0", "lines": 42, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/vesync/update.py
"""Update entity for VeSync..""" from pyvesync.base_devices.vesyncbasedevice import VeSyncBaseDevice from pyvesync.device_container import DeviceContainer from homeassistant.components.update import UpdateDeviceClass, UpdateEntity from homeassistant.core import HomeAssistant, callback from homeassistant.helpers.dispa...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/vesync/update.py", "license": "Apache License 2.0", "lines": 53, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/victron_ble/config_flow.py
"""Config flow for Victron Bluetooth Low Energy integration.""" from __future__ import annotations import logging from typing import Any from victron_ble_ha_parser import VictronBluetoothDeviceData import voluptuous as vol from homeassistant.components.bluetooth import ( BluetoothServiceInfoBleak, async_dis...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/victron_ble/config_flow.py", "license": "Apache License 2.0", "lines": 100, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/victron_ble/sensor.py
"""Sensor platform for Victron BLE.""" from collections.abc import Callable from dataclasses import dataclass import logging from typing import Any from sensor_state_data import DeviceKey from victron_ble_ha_parser import Keys, Units from homeassistant.components.bluetooth.passive_update_processor import ( Passi...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/victron_ble/sensor.py", "license": "Apache License 2.0", "lines": 453, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/volvo/lock.py
"""Volvo locks.""" from dataclasses import dataclass import logging from typing import Any, cast from volvocarsapi.models import VolvoApiException, VolvoCarsApiBaseModel, VolvoCarsValue from homeassistant.components.lock import LockEntity, LockEntityDescription from homeassistant.core import HomeAssistant from homea...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/volvo/lock.py", "license": "Apache License 2.0", "lines": 108, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/waqi/diagnostics.py
"""Diagnostics support for WAQI.""" from __future__ import annotations from dataclasses import asdict from typing import Any from homeassistant.core import HomeAssistant from .coordinator import WAQIConfigEntry async def async_get_config_entry_diagnostics( hass: HomeAssistant, entry: WAQIConfigEntry ) -> dict...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/waqi/diagnostics.py", "license": "Apache License 2.0", "lines": 14, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/websocket_api/automation.py
"""Automation related helper methods for the Websocket API.""" from __future__ import annotations from collections.abc import Mapping from dataclasses import dataclass from enum import StrEnum import logging from typing import Any, Self from homeassistant.const import CONF_TARGET from homeassistant.core import HomeA...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/websocket_api/automation.py", "license": "Apache License 2.0", "lines": 265, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/xbox/diagnostics.py
"""Diagnostics platform for the Xbox integration.""" from __future__ import annotations from typing import Any from homeassistant.components.diagnostics import async_redact_data from homeassistant.core import HomeAssistant from .coordinator import XboxConfigEntry TO_REDACT = { "bio", "display_name", "d...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/xbox/diagnostics.py", "license": "Apache License 2.0", "lines": 50, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/helpers/template/extensions/areas.py
"""Area functions for Home Assistant templates.""" from __future__ import annotations from collections.abc import Iterable from typing import TYPE_CHECKING import voluptuous as vol from homeassistant.helpers import ( area_registry as ar, device_registry as dr, entity_registry as er, ) from homeassistant...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/helpers/template/extensions/areas.py", "license": "Apache License 2.0", "lines": 140, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/helpers/template/extensions/datetime.py
"""DateTime functions for Home Assistant templates.""" from __future__ import annotations from datetime import date, datetime, time, timedelta from typing import TYPE_CHECKING, Any from homeassistant.helpers.template.helpers import raise_no_default from homeassistant.helpers.template.render_info import render_info_c...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/helpers/template/extensions/datetime.py", "license": "Apache License 2.0", "lines": 279, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/helpers/template/extensions/devices.py
"""Device functions for Home Assistant templates.""" from __future__ import annotations from collections.abc import Iterable from typing import TYPE_CHECKING, Any import voluptuous as vol from homeassistant.exceptions import TemplateError from homeassistant.helpers import ( config_validation as cv, device_r...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/helpers/template/extensions/devices.py", "license": "Apache License 2.0", "lines": 121, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/helpers/template/extensions/floors.py
"""Floor functions for Home Assistant templates.""" from __future__ import annotations from collections.abc import Iterable from typing import TYPE_CHECKING, Any from homeassistant.helpers import ( area_registry as ar, device_registry as dr, entity_registry as er, floor_registry as fr, ) from homeass...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/helpers/template/extensions/floors.py", "license": "Apache License 2.0", "lines": 133, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/helpers/template/extensions/issues.py
"""Issue functions for Home Assistant templates.""" from __future__ import annotations from typing import TYPE_CHECKING, Any from homeassistant.helpers import issue_registry as ir from .base import BaseTemplateExtension, TemplateFunction if TYPE_CHECKING: from homeassistant.helpers.template import TemplateEnvi...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/helpers/template/extensions/issues.py", "license": "Apache License 2.0", "lines": 44, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/helpers/template/extensions/labels.py
"""Label functions for Home Assistant templates.""" from __future__ import annotations from collections.abc import Iterable from typing import TYPE_CHECKING, Any import voluptuous as vol from homeassistant.helpers import ( area_registry as ar, device_registry as dr, entity_registry as er, label_regi...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/helpers/template/extensions/labels.py", "license": "Apache License 2.0", "lines": 145, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:script/hassfest/labs.py
"""Generate lab preview features file.""" from __future__ import annotations from .model import Config, Integration from .serializer import format_python_namespace def generate_and_validate(integrations: dict[str, Integration]) -> str: """Validate and generate lab preview features data.""" labs_dict: dict[s...
{ "repo_id": "home-assistant/core", "file_path": "script/hassfest/labs.py", "license": "Apache License 2.0", "lines": 64, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:tests/components/adguard/test_init.py
"""Tests for the AdGuard Home.""" from unittest.mock import AsyncMock from adguardhome import AdGuardHomeConnectionError import pytest from homeassistant.config_entries import ConfigEntryState from homeassistant.const import Platform from homeassistant.core import HomeAssistant from tests.common import MockConfigEn...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/adguard/test_init.py", "license": "Apache License 2.0", "lines": 29, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/adguard/test_sensor.py
"""Tests for the AdGuard Home sensor entities.""" import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.const import Platform from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_registry as er from tests.common import MockConfigEntry, snapshot_platform @p...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/adguard/test_sensor.py", "license": "Apache License 2.0", "lines": 20, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/adguard/test_service.py
"""Tests for the AdGuard Home sensor entities.""" from collections.abc import Callable from typing import Any from unittest.mock import AsyncMock import pytest from homeassistant.components.adguard.const import ( DOMAIN, SERVICE_ADD_URL, SERVICE_DISABLE_URL, SERVICE_ENABLE_URL, SERVICE_REFRESH, ...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/adguard/test_service.py", "license": "Apache License 2.0", "lines": 76, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/adguard/test_update.py
"""Tests for the AdGuard Home update entity.""" from unittest.mock import AsyncMock, patch from adguardhome import AdGuardHomeError from adguardhome.update import AdGuardHomeAvailableUpdate import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.const import Platform from homeassistant.core i...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/adguard/test_update.py", "license": "Apache License 2.0", "lines": 65, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/airobot/test_climate.py
"""Test the Airobot climate platform.""" from datetime import timedelta from unittest.mock import AsyncMock from freezegun.api import FrozenDateTimeFactory from pyairobotrest.const import MODE_AWAY, MODE_HOME from pyairobotrest.exceptions import AirobotConnectionError, AirobotError from pyairobotrest.models import Th...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/airobot/test_climate.py", "license": "Apache License 2.0", "lines": 228, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/airobot/test_config_flow.py
"""Test the Airobot config flow.""" from unittest.mock import AsyncMock from pyairobotrest.exceptions import ( AirobotAuthError, AirobotConnectionError, AirobotError, ) import pytest from homeassistant import config_entries from homeassistant.components.airobot.const import DOMAIN from homeassistant.cons...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/airobot/test_config_flow.py", "license": "Apache License 2.0", "lines": 355, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/airobot/test_init.py
"""Test the Airobot integration init.""" from unittest.mock import AsyncMock from pyairobotrest.exceptions import AirobotAuthError, AirobotConnectionError import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.airobot.const import DOMAIN from homeassistant.config_entries import Co...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/airobot/test_init.py", "license": "Apache License 2.0", "lines": 74, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/alarm_control_panel/test_trigger.py
"""Test alarm control panel triggers.""" from typing import Any import pytest from homeassistant.components.alarm_control_panel import ( AlarmControlPanelEntityFeature, AlarmControlPanelState, ) from homeassistant.const import ATTR_LABEL_ID, ATTR_SUPPORTED_FEATURES, CONF_ENTITY_ID from homeassistant.core imp...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/alarm_control_panel/test_trigger.py", "license": "Apache License 2.0", "lines": 357, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/anglian_water/const.py
"""Constants for the Anglian Water test suite.""" ACCOUNT_NUMBER = "171266493" ACCESS_TOKEN = "valid_token" USERNAME = "hello@example.com" PASSWORD = "SecurePassword123"
{ "repo_id": "home-assistant/core", "file_path": "tests/components/anglian_water/const.py", "license": "Apache License 2.0", "lines": 5, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/anglian_water/test_config_flow.py
"""Test the Anglian Water config flow.""" from unittest.mock import AsyncMock from pyanglianwater.exceptions import ( InvalidAccountIdError, SelfAssertedError, SmartMeterUnavailableError, ) import pytest from homeassistant import config_entries from homeassistant.components.anglian_water.const import CON...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/anglian_water/test_config_flow.py", "license": "Apache License 2.0", "lines": 223, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/anglian_water/test_sensor.py
"""Test Anglian Water sensors.""" from unittest.mock import AsyncMock, patch from syrupy.assertion import SnapshotAssertion from homeassistant.components.recorder import Recorder from homeassistant.const import Platform from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_registry as...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/anglian_water/test_sensor.py", "license": "Apache License 2.0", "lines": 24, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/anthropic/test_ai_task.py
"""Tests for the Anthropic integration.""" from pathlib import Path from unittest.mock import AsyncMock, patch from anthropic.types import Message, TextBlock, Usage from freezegun import freeze_time import pytest from syrupy.assertion import SnapshotAssertion import voluptuous as vol from homeassistant.components im...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/anthropic/test_ai_task.py", "license": "Apache License 2.0", "lines": 492, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/assist_satellite/test_trigger.py
"""Test assist satellite triggers.""" from typing import Any import pytest from homeassistant.components.assist_satellite.entity import AssistSatelliteState from homeassistant.const import ATTR_LABEL_ID, CONF_ENTITY_ID from homeassistant.core import HomeAssistant, ServiceCall from tests.components import ( Trig...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/assist_satellite/test_trigger.py", "license": "Apache License 2.0", "lines": 222, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/backblaze_b2/const.py
"""Consts for Backblaze B2 tests.""" from homeassistant.components.backblaze_b2.const import CONF_BUCKET, CONF_PREFIX from homeassistant.components.backup import AgentBackup USER_INPUT = { CONF_BUCKET: "testBucket", CONF_PREFIX: "testprefix/", } TEST_BACKUP = AgentBackup( addons=[], backup_id="23e64...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/backblaze_b2/const.py", "license": "Apache License 2.0", "lines": 26, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/backblaze_b2/test_backup.py
"""Backblaze B2 backup agent tests.""" import asyncio from collections.abc import AsyncGenerator from io import StringIO import json import logging import threading import time from unittest.mock import Mock, patch from b2sdk._internal.raw_simulator import BucketSimulator from b2sdk.v2.exception import B2Error import...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/backblaze_b2/test_backup.py", "license": "Apache License 2.0", "lines": 944, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/backblaze_b2/test_config_flow.py
"""Backblaze B2 config flow tests.""" from unittest.mock import patch from b2sdk.v2 import exception import pytest from homeassistant.components.backblaze_b2.const import ( CONF_APPLICATION_KEY, CONF_KEY_ID, DOMAIN, ) from homeassistant.config_entries import ( SOURCE_REAUTH, SOURCE_RECONFIGURE, ...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/backblaze_b2/test_config_flow.py", "license": "Apache License 2.0", "lines": 316, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/backblaze_b2/test_diagnostics.py
"""Test Backblaze B2 diagnostics.""" from unittest.mock import Mock, patch from homeassistant.components.backblaze_b2.diagnostics import ( async_get_config_entry_diagnostics, ) from homeassistant.core import HomeAssistant from . import setup_integration from tests.common import MockConfigEntry async def test_...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/backblaze_b2/test_diagnostics.py", "license": "Apache License 2.0", "lines": 67, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/backblaze_b2/test_init.py
"""Test the Backblaze B2 storage integration.""" from datetime import datetime from unittest.mock import AsyncMock, MagicMock, patch from b2sdk.v2 import exception import pytest from homeassistant.components.backblaze_b2.const import CONF_APPLICATION_KEY from homeassistant.config_entries import ConfigEntryState from...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/backblaze_b2/test_init.py", "license": "Apache License 2.0", "lines": 83, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/backblaze_b2/test_repairs.py
"""Test Backblaze B2 repairs.""" from unittest.mock import Mock, patch from b2sdk.v2.exception import ( B2Error, NonExistentBucket, RestrictedBucket, Unauthorized, ) import pytest from homeassistant.components.backblaze_b2.repairs import ( async_check_for_repair_issues, async_create_fix_flow,...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/backblaze_b2/test_repairs.py", "license": "Apache License 2.0", "lines": 47, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/bang_olufsen/util.py
"""Various utilities for Bang & Olufsen testing.""" from inflection import underscore from homeassistant.components.bang_olufsen.const import ( BEO_REMOTE_CONTROL_KEYS, BEO_REMOTE_KEYS, BEO_REMOTE_SUBMENU_CONTROL, BEO_REMOTE_SUBMENU_LIGHT, DEVICE_BUTTONS, ) from .const import ( TEST_BATTERY_C...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/bang_olufsen/util.py", "license": "Apache License 2.0", "lines": 78, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/binary_sensor/test_trigger.py
"""Test binary sensor trigger.""" from typing import Any import pytest from homeassistant.const import ( ATTR_DEVICE_CLASS, ATTR_LABEL_ID, CONF_ENTITY_ID, STATE_OFF, STATE_ON, ) from homeassistant.core import HomeAssistant, ServiceCall from tests.components import ( TriggerStateDescription, ...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/binary_sensor/test_trigger.py", "license": "Apache License 2.0", "lines": 231, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/climate/test_trigger.py
"""Test climate trigger.""" from contextlib import AbstractContextManager, nullcontext as does_not_raise from typing import Any import pytest import voluptuous as vol from homeassistant.components.climate.const import ( ATTR_CURRENT_HUMIDITY, ATTR_CURRENT_TEMPERATURE, ATTR_HUMIDITY, ATTR_HVAC_ACTION,...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/climate/test_trigger.py", "license": "Apache License 2.0", "lines": 562, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/cloud/test_ai_task.py
"""Tests for the Home Assistant Cloud AI Task entity.""" from __future__ import annotations from pathlib import Path from unittest.mock import AsyncMock, MagicMock, patch from hass_nabucasa.llm import ( LLMAuthenticationError, LLMError, LLMImageAttachment, LLMRateLimitError, LLMResponseError, ...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/cloud/test_ai_task.py", "license": "Apache License 2.0", "lines": 290, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/cloud/test_conversation.py
"""Tests for the Home Assistant Cloud conversation entity.""" from __future__ import annotations from unittest.mock import AsyncMock, MagicMock, patch import pytest from homeassistant.components import conversation from homeassistant.components.cloud.const import DOMAIN from homeassistant.components.cloud.conversat...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/cloud/test_conversation.py", "license": "Apache License 2.0", "lines": 106, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/cloud/test_entity.py
"""Tests for helpers in the Home Assistant Cloud conversation entity.""" from __future__ import annotations import base64 import datetime from pathlib import Path from unittest.mock import AsyncMock, MagicMock, patch from PIL import Image import pytest import voluptuous as vol from homeassistant.components import c...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/cloud/test_entity.py", "license": "Apache License 2.0", "lines": 282, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/concord232/test_alarm_control_panel.py
"""Tests for the Concord232 alarm control panel platform.""" from __future__ import annotations from unittest.mock import MagicMock from freezegun.api import FrozenDateTimeFactory import pytest import requests from homeassistant.components.alarm_control_panel import ( DOMAIN as ALARM_DOMAIN, SERVICE_ALARM_A...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/concord232/test_alarm_control_panel.py", "license": "Apache License 2.0", "lines": 232, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/concord232/test_binary_sensor.py
"""Tests for the Concord232 binary sensor platform.""" from __future__ import annotations import datetime from unittest.mock import MagicMock from freezegun.api import FrozenDateTimeFactory import pytest import requests from homeassistant.components.binary_sensor import ( DOMAIN as BINARY_SENSOR_DOMAIN, Bin...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/concord232/test_binary_sensor.py", "license": "Apache License 2.0", "lines": 164, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/duckdns/test_config_flow.py
"""Test the Duck DNS config flow.""" from unittest.mock import AsyncMock import pytest from homeassistant.components.duckdns import DOMAIN from homeassistant.config_entries import SOURCE_IMPORT, SOURCE_USER from homeassistant.const import CONF_ACCESS_TOKEN, CONF_DOMAIN from homeassistant.core import DOMAIN as HOMEAS...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/duckdns/test_config_flow.py", "license": "Apache License 2.0", "lines": 238, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/energy/test_data.py
"""Test energy data storage and migration.""" import pytest import voluptuous as vol from homeassistant.components.energy.data import ( ENERGY_SOURCE_SCHEMA, FLOW_FROM_GRID_SOURCE_SCHEMA, POWER_CONFIG_SCHEMA, EnergyManager, ) from homeassistant.core import HomeAssistant from homeassistant.helpers impo...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/energy/test_data.py", "license": "Apache License 2.0", "lines": 732, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/energy/test_validate_power.py
"""Test power stat validation.""" import pytest from homeassistant.components.energy import validate from homeassistant.components.energy.data import EnergyManager from homeassistant.const import UnitOfPower from homeassistant.core import HomeAssistant POWER_UNITS_STRING = ", ".join(tuple(UnitOfPower)) @pytest.fix...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/energy/test_validate_power.py", "license": "Apache License 2.0", "lines": 366, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/energyid/test_config_flow.py
"""Test EnergyID config flow.""" from collections.abc import Generator from unittest.mock import AsyncMock, MagicMock, patch from aiohttp import ClientError, ClientResponseError import pytest from homeassistant import config_entries from homeassistant.components.energyid.config_flow import EnergyIDConfigFlow from ho...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/energyid/test_config_flow.py", "license": "Apache License 2.0", "lines": 803, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/energyid/test_energyid_sensor_mapping_flow.py
"""Test EnergyID sensor mapping subentry flow (direct handler tests).""" from typing import Any from unittest.mock import patch import pytest from homeassistant.components.energyid.const import ( CONF_DEVICE_ID, CONF_ENERGYID_KEY, CONF_HA_ENTITY_UUID, CONF_PROVISIONING_KEY, CONF_PROVISIONING_SECR...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/energyid/test_energyid_sensor_mapping_flow.py", "license": "Apache License 2.0", "lines": 368, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/energyid/test_init.py
"""Tests for EnergyID integration initialization.""" from datetime import timedelta from unittest.mock import ANY, AsyncMock, MagicMock, patch from aiohttp import ClientError, ClientResponseError from homeassistant.components.energyid import ( DOMAIN, _async_handle_state_change, async_unload_entry, ) fro...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/energyid/test_init.py", "license": "Apache License 2.0", "lines": 1160, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/esphome/test_websocket_api.py
"""Tests for ESPHome websocket API.""" from homeassistant.components.esphome.const import CONF_NOISE_PSK from homeassistant.components.esphome.websocket_api import ENTRY_ID, TYPE from tests.common import MockConfigEntry from tests.typing import WebSocketGenerator async def test_get_encryption_key( init_integrat...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/esphome/test_websocket_api.py", "license": "Apache License 2.0", "lines": 23, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/essent/test_config_flow.py
"""Tests for Essent config flow.""" from unittest.mock import AsyncMock from essent_dynamic_pricing import ( EssentConnectionError, EssentDataError, EssentResponseError, ) import pytest from homeassistant.components.essent.const import DOMAIN from homeassistant.config_entries import SOURCE_USER from home...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/essent/test_config_flow.py", "license": "Apache License 2.0", "lines": 64, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/essent/test_init.py
"""Tests for Essent integration setup.""" from unittest.mock import AsyncMock from essent_dynamic_pricing import ( EssentConnectionError, EssentDataError, EssentError, EssentResponseError, ) import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.essent.const import...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/essent/test_init.py", "license": "Apache License 2.0", "lines": 60, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/essent/test_sensor.py
"""Tests for Essent sensors.""" from datetime import timedelta from unittest.mock import AsyncMock from freezegun.api import FrozenDateTimeFactory import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.essent.const import UPDATE_INTERVAL from homeassistant.core import HomeAssistan...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/essent/test_sensor.py", "license": "Apache License 2.0", "lines": 61, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/fan/test_trigger.py
"""Test fan trigger.""" from typing import Any import pytest from homeassistant.const import ATTR_LABEL_ID, CONF_ENTITY_ID, STATE_OFF, STATE_ON from homeassistant.core import HomeAssistant, ServiceCall from tests.components import ( TriggerStateDescription, arm_trigger, parametrize_target_entities, ...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/fan/test_trigger.py", "license": "Apache License 2.0", "lines": 188, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/go2rtc/test_docker_version.py
"""Test that the go2rtc Docker image version matches or exceeds the recommended version. This test ensures that the go2rtc Docker image SHA pinned in script/hassfest/docker.py corresponds to a version that is equal to or greater than the RECOMMENDED_VERSION defined in homeassistant/components/go2rtc/const.py. The tes...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/go2rtc/test_docker_version.py", "license": "Apache License 2.0", "lines": 66, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/goodwe/test_init.py
"""Test the GoodWe initialization.""" from unittest.mock import MagicMock from homeassistant.components.goodwe import CONF_MODEL_FAMILY, DOMAIN from homeassistant.const import CONF_HOST, CONF_PORT from homeassistant.core import HomeAssistant from homeassistant.setup import async_setup_component from .conftest import...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/goodwe/test_init.py", "license": "Apache License 2.0", "lines": 28, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/google_air_quality/test_config_flow.py
"""Test the Google Air Quality config flow.""" from unittest.mock import AsyncMock from google_air_quality_api.exceptions import GoogleAirQualityApiError import pytest from homeassistant.components.google_air_quality.const import ( CONF_REFERRER, DOMAIN, SECTION_API_KEY_OPTIONS, ) from homeassistant.conf...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/google_air_quality/test_config_flow.py", "license": "Apache License 2.0", "lines": 343, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/google_air_quality/test_init.py
"""Tests for Google Air Quality.""" from unittest.mock import AsyncMock from google_air_quality_api.exceptions import GoogleAirQualityApiError from homeassistant.config_entries import ConfigEntryState from homeassistant.core import HomeAssistant from tests.common import MockConfigEntry async def test_setup( h...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/google_air_quality/test_init.py", "license": "Apache License 2.0", "lines": 28, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/google_air_quality/test_sensor.py
"""Test the Google Air Quality sensor.""" from unittest.mock import AsyncMock, patch from syrupy.assertion import SnapshotAssertion from homeassistant.config_entries import ConfigEntryState from homeassistant.const import Platform from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/google_air_quality/test_sensor.py", "license": "Apache License 2.0", "lines": 26, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/google_weather/test_config_flow.py
"""Test the Google Weather config flow.""" from unittest.mock import AsyncMock from google_weather_api import GoogleWeatherApiError import pytest from homeassistant import config_entries from homeassistant.components.google_weather.const import ( CONF_REFERRER, DOMAIN, SECTION_API_KEY_OPTIONS, ) from hom...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/google_weather/test_config_flow.py", "license": "Apache License 2.0", "lines": 319, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/google_weather/test_init.py
"""Test init of Google Weather integration.""" from unittest.mock import AsyncMock from google_weather_api import GoogleWeatherApiError import pytest from homeassistant.components.google_weather.const import DOMAIN from homeassistant.config_entries import ConfigEntryState from homeassistant.const import STATE_UNAVAI...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/google_weather/test_init.py", "license": "Apache License 2.0", "lines": 52, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/google_weather/test_sensor.py
"""Test sensor of Google Weather integration.""" from datetime import timedelta from unittest.mock import AsyncMock, patch from freezegun.api import FrozenDateTimeFactory from google_weather_api import GoogleWeatherApiError import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.ho...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/google_weather/test_sensor.py", "license": "Apache License 2.0", "lines": 138, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/google_weather/test_weather.py
"""Test weather of Google Weather integration.""" from datetime import timedelta from unittest.mock import AsyncMock, patch from freezegun.api import FrozenDateTimeFactory from google_weather_api import GoogleWeatherApiError, WeatherCondition import pytest from syrupy.assertion import SnapshotAssertion from homeassi...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/google_weather/test_weather.py", "license": "Apache License 2.0", "lines": 179, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/hanna/test_config_flow.py
"""Tests for the Hanna Instruments integration config flow.""" from unittest.mock import AsyncMock, MagicMock from hanna_cloud import AuthenticationError import pytest from requests.exceptions import ConnectionError as RequestsConnectionError, Timeout from homeassistant.components.hanna.const import DOMAIN from home...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/hanna/test_config_flow.py", "license": "Apache License 2.0", "lines": 108, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/hue_ble/test_config_flow.py
"""Test the Hue BLE config flow.""" from unittest.mock import AsyncMock, PropertyMock, patch from habluetooth import BluetoothServiceInfoBleak from HueBLE import ConnectionError, HueBleError, PairingError import pytest from homeassistant.components.hue_ble.config_flow import Error from homeassistant.components.hue_b...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/hue_ble/test_config_flow.py", "license": "Apache License 2.0", "lines": 317, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/hue_ble/test_init.py
"""Test hue_ble setup process.""" from unittest.mock import patch from bleak.backends.device import BLEDevice from HueBLE import ConnectionError, HueBleError import pytest from homeassistant.components.hue_ble.const import DOMAIN from homeassistant.config_entries import ConfigEntryState from homeassistant.core impor...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/hue_ble/test_init.py", "license": "Apache License 2.0", "lines": 113, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/hue_ble/test_light.py
"""Hue BLE light tests.""" from unittest.mock import AsyncMock from syrupy.assertion import SnapshotAssertion from homeassistant.config_entries import ConfigEntryState from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_registry as er from tests.common import MockConfigEntry, snaps...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/hue_ble/test_light.py", "license": "Apache License 2.0", "lines": 21, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/labs/test_init.py
"""Tests for the Home Assistant Labs integration setup.""" from __future__ import annotations from typing import Any from unittest.mock import Mock, patch import pytest from homeassistant.components.labs import ( EVENT_LABS_UPDATED, EventLabsUpdatedData, async_is_preview_feature_enabled, async_liste...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/labs/test_init.py", "license": "Apache License 2.0", "lines": 488, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/labs/test_websocket_api.py
"""Tests for the Home Assistant Labs WebSocket API.""" from __future__ import annotations from typing import Any from unittest.mock import ANY, AsyncMock, patch import pytest from homeassistant.components.labs import ( EVENT_LABS_UPDATED, async_is_preview_feature_enabled, async_setup, ) from homeassista...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/labs/test_websocket_api.py", "license": "Apache License 2.0", "lines": 735, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/lawn_mower/test_trigger.py
"""Test lawn mower triggers.""" from typing import Any import pytest from homeassistant.components.lawn_mower import LawnMowerActivity from homeassistant.const import ATTR_LABEL_ID, CONF_ENTITY_ID from homeassistant.core import HomeAssistant, ServiceCall from tests.components import ( TriggerStateDescription, ...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/lawn_mower/test_trigger.py", "license": "Apache License 2.0", "lines": 222, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/light/test_condition.py
"""Test light conditions.""" from typing import Any import pytest from homeassistant.const import STATE_OFF, STATE_ON from homeassistant.core import HomeAssistant from tests.components import ( ConditionStateDescription, assert_condition_gated_by_labs_flag, create_target_condition, parametrize_condi...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/light/test_condition.py", "license": "Apache License 2.0", "lines": 151, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/light/test_trigger.py
"""Test light trigger.""" from typing import Any import pytest from homeassistant.components.light import ATTR_BRIGHTNESS from homeassistant.const import ( ATTR_LABEL_ID, CONF_ABOVE, CONF_BELOW, CONF_ENTITY_ID, STATE_OFF, STATE_ON, ) from homeassistant.core import HomeAssistant, ServiceCall f...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/light/test_trigger.py", "license": "Apache License 2.0", "lines": 462, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/media_player/test_trigger.py
"""Test media player trigger.""" from typing import Any import pytest from homeassistant.components.media_player import MediaPlayerState from homeassistant.const import ATTR_LABEL_ID, CONF_ENTITY_ID from homeassistant.core import HomeAssistant, ServiceCall from tests.components import ( TriggerStateDescription,...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/media_player/test_trigger.py", "license": "Apache License 2.0", "lines": 197, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/miele/test_select.py
"""Tests for miele select module.""" from unittest.mock import MagicMock, Mock from aiohttp import ClientResponseError import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.select import DOMAIN as SELECT_DOMAIN from homeassistant.const import ATTR_ENTITY_ID, ATTR_OPTION, SERVICE_...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/miele/test_select.py", "license": "Apache License 2.0", "lines": 75, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/mobile_app/test_pending_updates.py
"""Tests for mobile_app pending updates functionality.""" from http import HTTPStatus from typing import Any from aiohttp.test_utils import TestClient from homeassistant.const import PERCENTAGE from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_registry as er async def test_pendi...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/mobile_app/test_pending_updates.py", "license": "Apache License 2.0", "lines": 530, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/nederlandse_spoorwegen/test_binary_sensor.py
"""Test the Nederlandse Spoorwegen binary sensor.""" from collections.abc import Generator from unittest.mock import AsyncMock, patch import pytest from requests.exceptions import ConnectionError as RequestsConnectionError from syrupy.assertion import SnapshotAssertion from homeassistant.const import STATE_UNKNOWN, ...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/nederlandse_spoorwegen/test_binary_sensor.py", "license": "Apache License 2.0", "lines": 58, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/niko_home_control/test_climate.py
"""Tests for the Niko Home Control Climate platform.""" from typing import Any from unittest.mock import AsyncMock, patch import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.climate import ATTR_HVAC_MODE, ATTR_PRESET_MODE, HVACMode from homeassistant.const import ATTR_ENTITY_ID...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/niko_home_control/test_climate.py", "license": "Apache License 2.0", "lines": 96, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/point/test_init.py
"""Tests for the Point component.""" from unittest.mock import patch from homeassistant.components.point import DOMAIN from homeassistant.config_entries import ConfigEntryState from homeassistant.core import HomeAssistant from homeassistant.helpers.config_entry_oauth2_flow import ( ImplementationUnavailableError,...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/point/test_init.py", "license": "Apache License 2.0", "lines": 33, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/pooldose/test_binary_sensor.py
"""Test the PoolDose binary sensor platform.""" from datetime import timedelta from unittest.mock import AsyncMock, patch from freezegun.api import FrozenDateTimeFactory from pooldose.request_status import RequestStatus import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.const import STAT...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/pooldose/test_binary_sensor.py", "license": "Apache License 2.0", "lines": 151, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/pooldose/test_switch.py
"""Tests for the Seko PoolDose switch platform.""" from unittest.mock import AsyncMock from pooldose.request_status import RequestStatus import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN from homeassistant.const import ATTR_ENTITY_ID, STA...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/pooldose/test_switch.py", "license": "Apache License 2.0", "lines": 160, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/ridwell/test_calendar.py
"""Test Ridwell calendar platform.""" from datetime import date from aioridwell.model import EventState, RidwellPickup, RidwellPickupEvent import pytest from homeassistant.components.calendar import CalendarEvent from homeassistant.components.ridwell.calendar import ( async_get_calendar_event_from_pickup_event, ...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/ridwell/test_calendar.py", "license": "Apache License 2.0", "lines": 126, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/satel_integra/test_alarm_control_panel.py
"""Test Satel Integra alarm panel.""" from collections.abc import AsyncGenerator from unittest.mock import AsyncMock, patch import pytest from satel_integra.satel_integra import AlarmState from syrupy.assertion import SnapshotAssertion from homeassistant.components.alarm_control_panel import ( DOMAIN as ALARM_DO...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/satel_integra/test_alarm_control_panel.py", "license": "Apache License 2.0", "lines": 188, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/satel_integra/test_binary_sensor.py
"""Test Satel Integra Binary Sensor.""" from collections.abc import AsyncGenerator from unittest.mock import AsyncMock, patch from freezegun.api import FrozenDateTimeFactory import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.satel_integra.const import DOMAIN from homeassistant...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/satel_integra/test_binary_sensor.py", "license": "Apache License 2.0", "lines": 119, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/satel_integra/test_switch.py
"""Test Satel Integra switch.""" from collections.abc import AsyncGenerator from unittest.mock import AsyncMock, patch from freezegun.api import FrozenDateTimeFactory import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.satel_integra.const import DOMAIN from homeassistant.compon...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/satel_integra/test_switch.py", "license": "Apache License 2.0", "lines": 167, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/saunum/test_climate.py
"""Test the Saunum climate platform.""" from __future__ import annotations from dataclasses import replace from freezegun.api import FrozenDateTimeFactory from pysaunum import SaunumException import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.climate import ( ATTR_CURRENT...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/saunum/test_climate.py", "license": "Apache License 2.0", "lines": 465, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/saunum/test_config_flow.py
"""Test the Saunum config flow.""" from __future__ import annotations from unittest.mock import AsyncMock from pysaunum import SaunumConnectionError, SaunumException import pytest from homeassistant.components.saunum.const import ( DOMAIN, OPT_PRESET_NAME_TYPE_1, OPT_PRESET_NAME_TYPE_2, OPT_PRESET_N...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/saunum/test_config_flow.py", "license": "Apache License 2.0", "lines": 228, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/saunum/test_diagnostics.py
"""Test Saunum Leil Sauna diagnostics.""" 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 async def test_ent...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/saunum/test_diagnostics.py", "license": "Apache License 2.0", "lines": 17, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/saunum/test_init.py
"""Test Saunum Leil integration setup and teardown.""" from unittest.mock import patch from pysaunum import SaunumConnectionError import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.saunum.const import DOMAIN from homeassistant.config_entries import ConfigEntryState from homeas...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/saunum/test_init.py", "license": "Apache License 2.0", "lines": 47, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/saunum/test_light.py
"""Test the Saunum light platform.""" from __future__ import annotations from dataclasses import replace from pysaunum import SaunumException import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.light import DOMAIN as LIGHT_DOMAIN from homeassistant.const import ( ATTR_ENTI...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/saunum/test_light.py", "license": "Apache License 2.0", "lines": 96, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/senz/test_climate.py
"""Test Senz climate platform.""" from unittest.mock import MagicMock, patch from httpx import RequestError import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.climate import ( ATTR_HVAC_MODE, DOMAIN as CLIMATE_DOMAIN, HVACMode, ) from homeassistant.const import ATT...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/senz/test_climate.py", "license": "Apache License 2.0", "lines": 132, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/senz/test_diagnostics.py
"""Tests for the diagnostics data provided by the senz integration.""" from collections.abc import Generator from unittest.mock import MagicMock from syrupy.assertion import SnapshotAssertion from syrupy.filters import paths from homeassistant.core import HomeAssistant from . import setup_integration from tests.co...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/senz/test_diagnostics.py", "license": "Apache License 2.0", "lines": 27, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/senz/test_init.py
"""Test init of senz integration.""" from http import HTTPStatus import time from unittest.mock import MagicMock, Mock, patch from httpx import HTTPStatusError, RequestError from pysenz import TOKEN_ENDPOINT import pytest from homeassistant.components.senz.const import DOMAIN from homeassistant.config_entries import...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/senz/test_init.py", "license": "Apache License 2.0", "lines": 135, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/senz/test_sensor.py
"""Test Senz sensor platform.""" from unittest.mock import MagicMock, patch from syrupy.assertion import SnapshotAssertion from homeassistant.const import Platform from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_registry as er from . import setup_integration from tests.common ...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/senz/test_sensor.py", "license": "Apache License 2.0", "lines": 21, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/switchbot/test_climate.py
"""Tests for the Switchbot climate integration.""" from collections.abc import Callable from unittest.mock import AsyncMock, patch import pytest from switchbot import SwitchbotOperationError from homeassistant.components.climate import ( DOMAIN as CLIMATE_DOMAIN, SERVICE_SET_HVAC_MODE, SERVICE_SET_PRESET...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/switchbot/test_climate.py", "license": "Apache License 2.0", "lines": 102, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/tesla_fleet/test_update.py
"""Test the Tesla Fleet update platform.""" import copy import time from typing import Any from unittest.mock import AsyncMock, patch from freezegun.api import FrozenDateTimeFactory from syrupy.assertion import SnapshotAssertion from homeassistant.components.tesla_fleet.coordinator import VEHICLE_INTERVAL from homea...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/tesla_fleet/test_update.py", "license": "Apache License 2.0", "lines": 140, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/text/test_trigger.py
"""Test text trigger.""" import pytest from homeassistant.const import ( ATTR_LABEL_ID, CONF_ENTITY_ID, STATE_UNAVAILABLE, STATE_UNKNOWN, ) from homeassistant.core import HomeAssistant, ServiceCall from tests.components import ( TriggerStateDescription, arm_trigger, parametrize_target_ent...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/text/test_trigger.py", "license": "Apache License 2.0", "lines": 122, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/toon/test_init.py
"""Tests for the Toon component.""" from unittest.mock import patch from homeassistant.components.toon import DOMAIN from homeassistant.config_entries import ConfigEntryState from homeassistant.core import HomeAssistant from homeassistant.helpers.config_entry_oauth2_flow import ( ImplementationUnavailableError, )...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/toon/test_init.py", "license": "Apache License 2.0", "lines": 59, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/vacuum/test_trigger.py
"""Test vacuum triggers.""" from typing import Any import pytest from homeassistant.components.vacuum import VacuumActivity from homeassistant.const import ATTR_LABEL_ID, CONF_ENTITY_ID from homeassistant.core import HomeAssistant, ServiceCall from tests.components import ( TriggerStateDescription, arm_trig...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/vacuum/test_trigger.py", "license": "Apache License 2.0", "lines": 238, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/velux/test_button.py
"""Test Velux button entities.""" from unittest.mock import AsyncMock, MagicMock import pytest from pyvlx import PyVLXException from syrupy.assertion import SnapshotAssertion from homeassistant.components.button import DOMAIN as BUTTON_DOMAIN, SERVICE_PRESS from homeassistant.components.velux import DOMAIN from home...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/velux/test_button.py", "license": "Apache License 2.0", "lines": 80, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/velux/test_light.py
"""Test Velux light entities.""" from unittest.mock import AsyncMock, MagicMock import pytest from homeassistant.components.light import ( ATTR_BRIGHTNESS, DOMAIN as LIGHT_DOMAIN, SERVICE_TURN_OFF, SERVICE_TURN_ON, ) from homeassistant.const import STATE_OFF, STATE_ON, STATE_UNAVAILABLE, Platform fro...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/velux/test_light.py", "license": "Apache License 2.0", "lines": 191, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/velux/test_scene.py
"""Test Velux scene entities.""" import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.scene import DOMAIN as SCENE_DOMAIN, SERVICE_TURN_ON from homeassistant.components.velux import DOMAIN from homeassistant.const import ATTR_ENTITY_ID, Platform from homeassistant.core import Hom...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/velux/test_scene.py", "license": "Apache License 2.0", "lines": 55, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test