sample_id stringlengths 21 196 | text stringlengths 105 936k | metadata dict | category stringclasses 6
values |
|---|---|---|---|
home-assistant/core:homeassistant/components/yardian/binary_sensor.py | """Binary sensors for Yardian integration."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from homeassistant.components.binary_sensor import (
BinarySensorDeviceClass,
BinarySensorEntity,
BinarySensorEntityDescription,
)
from homeassistant.con... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/yardian/binary_sensor.py",
"license": "Apache License 2.0",
"lines": 107,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/zeroconf/repairs.py | """Repairs for the zeroconf integration."""
from __future__ import annotations
from homeassistant import data_entry_flow
from homeassistant.components.homeassistant import (
DOMAIN as HOMEASSISTANT_DOMAIN,
SERVICE_HOMEASSISTANT_RESTART,
)
from homeassistant.components.repairs import RepairsFlow
from homeassis... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/zeroconf/repairs.py",
"license": "Apache License 2.0",
"lines": 48,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/util/async_iterator.py | """Async iterator utilities."""
from __future__ import annotations
import asyncio
from collections.abc import AsyncIterator
from concurrent.futures import CancelledError, Future
from typing import Self
class Abort(Exception):
"""Raised when abort is requested."""
class AsyncIteratorReader:
"""Allow readin... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/util/async_iterator.py",
"license": "Apache License 2.0",
"lines": 113,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:tests/components/actron_air/test_config_flow.py | """Config flow tests for the Actron Air Integration."""
import asyncio
from unittest.mock import AsyncMock
from actron_neo_api import ActronAirAuthError
from homeassistant import config_entries
from homeassistant.components.actron_air.const import DOMAIN
from homeassistant.const import CONF_API_TOKEN
from homeassist... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/actron_air/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 194,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/control4/test_climate.py | """Test Control4 Climate."""
from typing import Any
from unittest.mock import MagicMock
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.climate import (
ATTR_FAN_MODE,
ATTR_HVAC_MODE,
ATTR_TARGET_TEMP_HIGH,
ATTR_TARGET_TEMP_LOW,
ATTR_TEMPERATURE,
DOM... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/control4/test_climate.py",
"license": "Apache License 2.0",
"lines": 496,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/control4/test_media_player.py | """Test Control4 Media Player."""
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 . import setup_integration
from tests.common import MockConfigEntry, snaps... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/control4/test_media_player.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/elevenlabs/test_stt.py | """Tests for the ElevenLabs STT integration."""
from unittest.mock import AsyncMock
from elevenlabs.core import ApiError
import pytest
from homeassistant.components import stt
from homeassistant.components.elevenlabs.const import (
CONF_MODEL,
CONF_STT_AUTO_LANGUAGE,
CONF_VOICE,
)
from homeassistant.core... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/elevenlabs/test_stt.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/fing/test_config_flow.py | """Tests for Fing config flow."""
import httpx
import pytest
from homeassistant.components.fing.const import DOMAIN
from homeassistant.config_entries import SOURCE_USER
from homeassistant.const import CONF_API_KEY, CONF_IP_ADDRESS, CONF_PORT
from homeassistant.core import HomeAssistant
from homeassistant.data_entry_f... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/fing/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 131,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/fing/test_device_tracker.py | """Test Fing Agent device tracker entity."""
from datetime import timedelta
from fing_agent_api.models import DeviceResponse
from freezegun.api import FrozenDateTimeFactory
from homeassistant.components.fing.const import DOMAIN
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_reg... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/fing/test_device_tracker.py",
"license": "Apache License 2.0",
"lines": 92,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/fing/test_init.py | """Test the Fing integration init."""
import pytest
from homeassistant.components.fing.const import DOMAIN
from homeassistant.config_entries import ConfigEntryState
from homeassistant.core import HomeAssistant
from . import init_integration
from tests.common import AsyncMock
from tests.conftest import MockConfigEnt... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/fing/test_init.py",
"license": "Apache License 2.0",
"lines": 35,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/firefly_iii/test_config_flow.py | """Test the Firefly III config flow."""
from unittest.mock import AsyncMock, MagicMock
from pyfirefly.exceptions import (
FireflyAuthenticationError,
FireflyConnectionError,
FireflyTimeoutError,
)
import pytest
from homeassistant.components.firefly_iii.const import DOMAIN
from homeassistant.config_entrie... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/firefly_iii/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 298,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/firefly_iii/test_diagnostics.py | """Test the Firefly III component diagnostics."""
from unittest.mock import AsyncMock
from syrupy.assertion import SnapshotAssertion
from syrupy.filters import props
from homeassistant.core import HomeAssistant
from . import setup_integration
from tests.common import MockConfigEntry
from tests.components.diagnosti... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/firefly_iii/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/firefly_iii/test_init.py | """Tests for the Firefly III integration."""
from unittest.mock import AsyncMock
from pyfirefly.exceptions import (
FireflyAuthenticationError,
FireflyConnectionError,
FireflyTimeoutError,
)
import pytest
from homeassistant.config_entries import ConfigEntryState
from homeassistant.core import HomeAssista... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/firefly_iii/test_init.py",
"license": "Apache License 2.0",
"lines": 31,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/firefly_iii/test_sensor.py | """Tests for the Firefly III sensor platform."""
from unittest.mock import AsyncMock, patch
from freezegun.api import FrozenDateTimeFactory
from pyfirefly.exceptions import (
FireflyAuthenticationError,
FireflyConnectionError,
FireflyTimeoutError,
)
import pytest
from syrupy.assertion import SnapshotAsse... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/firefly_iii/test_sensor.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/group/test_valve.py | """The tests for the group valve platform."""
import asyncio
from datetime import timedelta
from typing import Any
from unittest.mock import patch
import pytest
from homeassistant.components.group.valve import DEFAULT_NAME
from homeassistant.components.valve import (
ATTR_CURRENT_POSITION,
ATTR_POSITION,
... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/group/test_valve.py",
"license": "Apache License 2.0",
"lines": 585,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/growatt_server/test_init.py | """Tests for the Growatt Server integration."""
from datetime import timedelta
import json
from freezegun.api import FrozenDateTimeFactory
import growattServer
import pytest
import requests
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.growatt_server import async_migrate_entry
from hom... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/growatt_server/test_init.py",
"license": "Apache License 2.0",
"lines": 543,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/growatt_server/test_number.py | """Tests for the Growatt Server number platform."""
from collections.abc import AsyncGenerator
from unittest.mock import patch
from freezegun.api import FrozenDateTimeFactory
from growattServer import GrowattV1ApiError
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.growatt... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/growatt_server/test_number.py",
"license": "Apache License 2.0",
"lines": 210,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/growatt_server/test_sensor.py | """Tests for the Growatt Server sensor platform."""
from datetime import timedelta
from unittest.mock import patch
from freezegun.api import FrozenDateTimeFactory
import growattServer
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.const import STATE_UNAVAILABLE, Platform
from homeass... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/growatt_server/test_sensor.py",
"license": "Apache License 2.0",
"lines": 376,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/growatt_server/test_switch.py | """Tests for the Growatt Server switch platform."""
from collections.abc import AsyncGenerator
from unittest.mock import patch
from freezegun.api import FrozenDateTimeFactory
from growattServer import GrowattV1ApiError
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.growatt... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/growatt_server/test_switch.py",
"license": "Apache License 2.0",
"lines": 180,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/habitica/test_notify.py | """Tests for the Habitica notify platform."""
from collections.abc import AsyncGenerator
from datetime import timedelta
from typing import Any
from unittest.mock import AsyncMock, patch
from uuid import UUID
from aiohttp import ClientError
from freezegun.api import FrozenDateTimeFactory
from habiticalib import Habiti... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/habitica/test_notify.py",
"license": "Apache License 2.0",
"lines": 158,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/hassio/test_jobs.py | """Test supervisor jobs manager."""
from collections.abc import Generator
from datetime import datetime
import os
from unittest.mock import AsyncMock, patch
from uuid import uuid4
from aiohasupervisor.models import Job, JobsInfo
import pytest
from homeassistant.components.hassio.const import ADDONS_COORDINATOR
from ... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/hassio/test_jobs.py",
"license": "Apache License 2.0",
"lines": 304,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/homeassistant_connect_zbt2/test_switch.py | """Test Connect ZBT-2 beta firmware switch entity."""
from unittest.mock import Mock, call, patch
from ha_silabs_firmware_client import FirmwareManifest, FirmwareMetadata
import pytest
from yarl import URL
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN
from homeassistant.const import (
ATTR_... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/homeassistant_connect_zbt2/test_switch.py",
"license": "Apache License 2.0",
"lines": 118,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/homeassistant_hardware/common.py | """Common test constants for homeassistant_hardware tests."""
from ha_silabs_firmware_client import FirmwareManifest, FirmwareMetadata
from yarl import URL
from homeassistant.util import dt as dt_util
TEST_DOMAIN = "test"
TEST_FIRMWARE_RELEASES_URL = "https://example.org/firmware"
TEST_MANIFEST = FirmwareManifest(
... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/homeassistant_hardware/common.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/homeassistant_hardware/test_switch.py | """Test Home Assistant Hardware beta firmware switch entity."""
from __future__ import annotations
from collections.abc import AsyncGenerator
from unittest.mock import Mock, call, patch
import pytest
from homeassistant.components.homeassistant import DOMAIN as HOMEASSISTANT_DOMAIN
from homeassistant.components.home... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/homeassistant_hardware/test_switch.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/homeassistant_sky_connect/test_switch.py | """Test SkyConnect beta firmware switch entity."""
from unittest.mock import Mock, call, patch
from ha_silabs_firmware_client import FirmwareManifest, FirmwareMetadata
import pytest
from yarl import URL
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN
from homeassistant.const import (
ATTR_ENT... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/homeassistant_sky_connect/test_switch.py",
"license": "Apache License 2.0",
"lines": 116,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/homeassistant_yellow/test_switch.py | """Test Yellow beta firmware switch entity."""
from unittest.mock import Mock, call, patch
from ha_silabs_firmware_client import FirmwareManifest, FirmwareMetadata
import pytest
from yarl import URL
from homeassistant.components.homeassistant_yellow.const import RADIO_DEVICE
from homeassistant.components.switch impo... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/homeassistant_yellow/test_switch.py",
"license": "Apache License 2.0",
"lines": 118,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/inels/common.py | """Common methods used across tests."""
from homeassistant.components import inels
from homeassistant.components.inels.const import DOMAIN
from homeassistant.core import HomeAssistant, State
from homeassistant.helpers import device_registry as dr, entity_registry as er
from tests.common import MockConfigEntry
__all_... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/inels/common.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/inels/test_config_flow.py | """Test the iNELS config flow."""
from unittest.mock import patch
from homeassistant.components.inels.const import DOMAIN, TITLE
from homeassistant.components.mqtt import MQTT_CONNECTION_STATE
from homeassistant.config_entries import SOURCE_MQTT, SOURCE_USER
from homeassistant.core import HomeAssistant
from homeassis... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/inels/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 145,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/inels/test_init.py | """Tests for iNELS integration."""
from unittest.mock import ANY, AsyncMock, patch
import pytest
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryNotReady
from . import HA_INELS_PATH
from .common import DOMAIN, inels
from tests.common import MockConfigEntry
from tests.ty... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/inels/test_init.py",
"license": "Apache License 2.0",
"lines": 77,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/inels/test_switch.py | """iNELS switch platform testing."""
from unittest.mock import patch
import pytest
from homeassistant.components.switch import (
DOMAIN as SWITCH_DOMAIN,
SERVICE_TURN_OFF,
SERVICE_TURN_ON,
)
from homeassistant.const import ATTR_ENTITY_ID, STATE_OFF, STATE_ON, STATE_UNAVAILABLE
from homeassistant.core imp... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/inels/test_switch.py",
"license": "Apache License 2.0",
"lines": 146,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/libre_hardware_monitor/test_init.py | """Tests for the LibreHardwareMonitor init."""
import pytest
from homeassistant.components.libre_hardware_monitor.const import DOMAIN
from homeassistant.core import HomeAssistant
from homeassistant.helpers import device_registry as dr, entity_registry as er
from . import init_integration
from .conftest import VALID_... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/libre_hardware_monitor/test_init.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/london_underground/test_config_flow.py | """Test the London Underground config flow."""
import asyncio
import pytest
from homeassistant.components.london_underground.const import (
CONF_LINE,
DEFAULT_LINES,
DOMAIN,
)
from homeassistant.config_entries import SOURCE_IMPORT, SOURCE_USER
from homeassistant.core import HomeAssistant
from homeassista... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/london_underground/test_config_flow.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/london_underground/test_init.py | """Test the London Underground init."""
from homeassistant.core import HomeAssistant
async def test_reload_entry(
hass: HomeAssistant, mock_london_underground_client, mock_config_entry
) -> None:
"""Test reloading the config entry."""
# Test reloading with updated options
hass.config_entries.async_u... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/london_underground/test_init.py",
"license": "Apache License 2.0",
"lines": 15,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/lunatone/test_config_flow.py | """Define tests for the Lunatone config flow."""
from unittest.mock import AsyncMock
import aiohttp
import pytest
from homeassistant.components.lunatone.const import DOMAIN
from homeassistant.config_entries import SOURCE_USER
from homeassistant.const import CONF_URL
from homeassistant.core import HomeAssistant
from ... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/lunatone/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 150,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/lunatone/test_init.py | """Tests for the Lunatone integration."""
from unittest.mock import AsyncMock
import aiohttp
from homeassistant.components.lunatone.const import DOMAIN, MANUFACTURER
from homeassistant.config_entries import ConfigEntryState
from homeassistant.core import HomeAssistant
from homeassistant.helpers import device_registr... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/lunatone/test_init.py",
"license": "Apache License 2.0",
"lines": 98,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/lunatone/test_light.py | """Tests for the Lunatone integration."""
import copy
from unittest.mock import AsyncMock
from lunatone_rest_api_client.models import LineStatus
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.light import ATTR_BRIGHTNESS, DOMAIN as LIGHT_DOMAIN
from homeassistant.const import (
ATTR... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/lunatone/test_light.py",
"license": "Apache License 2.0",
"lines": 189,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/matrix/test_react.py | """Test the react service."""
import pytest
from homeassistant.components.matrix import DOMAIN, MatrixBot
from homeassistant.components.matrix.const import (
ATTR_MESSAGE_ID,
ATTR_REACTION,
ATTR_ROOM,
SERVICE_REACT,
)
from homeassistant.core import Event, HomeAssistant
from .conftest import TEST_JOIN... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/matrix/test_react.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/meteo_lt/test_config_flow.py | """Test the Meteo.lt config flow."""
from unittest.mock import AsyncMock
import aiohttp
from homeassistant.components.meteo_lt.const import CONF_PLACE_CODE, DOMAIN
from homeassistant.config_entries import SOURCE_USER
from homeassistant.core import HomeAssistant
from homeassistant.data_entry_flow import FlowResultTyp... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/meteo_lt/test_config_flow.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/meteo_lt/test_weather.py | """Test Meteo.lt weather entity."""
from collections.abc import Generator
from unittest.mock import patch
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 te... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/meteo_lt/test_weather.py",
"license": "Apache License 2.0",
"lines": 53,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/nederlandse_spoorwegen/test_init.py | """Test the Nederlandse Spoorwegen init."""
from syrupy.assertion import SnapshotAssertion
from homeassistant.core import HomeAssistant
import homeassistant.helpers.device_registry as dr
from . import setup_integration
from tests.common import MockConfigEntry
async def test_device_registry_integration(
hass: ... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/nederlandse_spoorwegen/test_init.py",
"license": "Apache License 2.0",
"lines": 22,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/niko_home_control/test_scene.py | """Tests for the Niko Home Control Scene platform."""
from unittest.mock import AsyncMock, patch
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.scene import DOMAIN as SCENE_DOMAIN
from homeassistant.const import ATTR_ENTITY_ID, SERVICE_TURN_ON, Platform
from homeassistant.... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/niko_home_control/test_scene.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/nintendo_parental_controls/test_config_flow.py | """Test the Nintendo Switch parental controls config flow."""
from unittest.mock import AsyncMock
from pynintendoauth.exceptions import HttpException, InvalidSessionTokenException
from homeassistant import config_entries
from homeassistant.components.nintendo_parental_controls.const import (
CONF_SESSION_TOKEN,
... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/nintendo_parental_controls/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 183,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/nintendo_parental_controls/test_coordinator.py | """Test coordinator error handling."""
from unittest.mock import AsyncMock
from pynintendoauth.exceptions import (
HttpException,
InvalidOAuthConfigurationException,
InvalidSessionTokenException,
)
from pynintendoparental.exceptions import NoDevicesFoundException
import pytest
from homeassistant.config_e... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/nintendo_parental_controls/test_coordinator.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/nintendo_parental_controls/test_init.py | """Test __init__ error handling."""
from unittest.mock import AsyncMock
from pynintendoauth.exceptions import InvalidOAuthConfigurationException
from homeassistant.config_entries import ConfigEntryState
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from . impor... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/nintendo_parental_controls/test_init.py",
"license": "Apache License 2.0",
"lines": 45,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/nintendo_parental_controls/test_number.py | """Test number platform for Nintendo Parental Controls."""
from unittest.mock import AsyncMock, patch
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.number import (
ATTR_VALUE,
DOMAIN as NUMBER_DOMAIN,
SERVICE_SET_VALUE,
)
from homeassistant.const import ATTR_ENTITY_ID, Plat... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/nintendo_parental_controls/test_number.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/nintendo_parental_controls/test_sensor.py | """Test sensor platform."""
from unittest.mock import AsyncMock, 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 impor... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/nintendo_parental_controls/test_sensor.py",
"license": "Apache License 2.0",
"lines": 22,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/nintendo_parental_controls/test_services.py | """Test Nintendo Parental Controls service calls."""
from unittest.mock import AsyncMock
import pytest
from homeassistant.components.nintendo_parental_controls.const import (
ATTR_BONUS_TIME,
DOMAIN,
)
from homeassistant.components.nintendo_parental_controls.services import (
NintendoParentalServices,
)
... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/nintendo_parental_controls/test_services.py",
"license": "Apache License 2.0",
"lines": 81,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/nintendo_parental_controls/test_switch.py | """Test switch platform."""
from unittest.mock import AsyncMock, patch
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.switch import (
DOMAIN as SWITCH_DOMAIN,
SERVICE_TURN_OFF,
SERVICE_TURN_ON,
)
from homeassistant.const import ATTR_ENTITY_ID, Platform
from homeassistant.cor... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/nintendo_parental_controls/test_switch.py",
"license": "Apache License 2.0",
"lines": 53,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/nintendo_parental_controls/test_time.py | """Test the time platform."""
from unittest.mock import AsyncMock, patch
from pynintendoparental.exceptions import BedtimeOutOfRangeError
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.time import (
ATTR_TIME,
DOMAIN as TIME_DOMAIN,
SERVICE_SET_VALUE,
)
from ho... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/nintendo_parental_controls/test_time.py",
"license": "Apache License 2.0",
"lines": 110,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/nmap_tracker/test_init.py | """Tests for the nmap_tracker component."""
from unittest.mock import patch
from homeassistant.components.nmap_tracker.const import (
CONF_HOME_INTERVAL,
CONF_HOSTS_EXCLUDE,
CONF_HOSTS_LIST,
CONF_MAC_EXCLUDE,
CONF_OPTIONS,
DEFAULT_OPTIONS,
DOMAIN,
)
from homeassistant.config_entries import... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/nmap_tracker/test_init.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/octoprint/test_number.py | """The tests for OctoPrint number module."""
from datetime import UTC, datetime
from typing import Any
from unittest.mock import patch
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.number import (
ATTR_VALUE,
DOMAIN as NUMBER_DOMAIN,
SERVICE_SET_VALUE,
)
from ... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/octoprint/test_number.py",
"license": "Apache License 2.0",
"lines": 216,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/onvif/test_util.py | """Test ONVIF util functions."""
from homeassistant.components.onvif.models import Event
from homeassistant.components.onvif.util import build_event_entity_names
# Example device UID that would be used as prefix
TEST_DEVICE_UID = "aa:bb:cc:dd:ee:ff"
def test_build_event_entity_names_unique_names() -> None:
"""T... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/onvif/test_util.py",
"license": "Apache License 2.0",
"lines": 100,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/openrgb/test_config_flow.py | """Tests for the OpenRGB config flow."""
import socket
from openrgb.utils import OpenRGBDisconnected, SDKVersionError
import pytest
from homeassistant.components.openrgb.const import DOMAIN
from homeassistant.config_entries import SOURCE_USER
from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PORT
from homea... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/openrgb/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 214,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/openrgb/test_init.py | """Tests for the OpenRGB integration init."""
import socket
from unittest.mock import MagicMock
from freezegun.api import FrozenDateTimeFactory
from openrgb.utils import ControllerParsingError, OpenRGBDisconnected, SDKVersionError
import pytest
from homeassistant.components.openrgb import async_remove_config_entry_d... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/openrgb/test_init.py",
"license": "Apache License 2.0",
"lines": 279,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/openrgb/test_light.py | """Tests for the OpenRGB light platform."""
from collections.abc import Generator
import copy
from unittest.mock import MagicMock, patch
from freezegun.api import FrozenDateTimeFactory
from openrgb.utils import OpenRGBDisconnected, RGBColor
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassist... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/openrgb/test_light.py",
"license": "Apache License 2.0",
"lines": 711,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/portainer/test_button.py | """Tests for the Portainer button platform."""
from __future__ import annotations
from unittest.mock import AsyncMock, patch
from pyportainer.exceptions import (
PortainerAuthenticationError,
PortainerConnectionError,
PortainerTimeoutError,
)
import pytest
from syrupy.assertion import SnapshotAssertion
... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/portainer/test_button.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/portainer/test_diagnostics.py | """Test the Portainer component diagnostics."""
from unittest.mock import AsyncMock
from syrupy.assertion import SnapshotAssertion
from syrupy.filters import props
from homeassistant.core import HomeAssistant
from . import setup_integration
from tests.common import MockConfigEntry
from tests.components.diagnostics... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/portainer/test_diagnostics.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/portainer/test_sensor.py | """Tests for the Portainer sensor platform."""
from unittest.mock import patch
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 . import setup_integration
f... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/portainer/test_sensor.py",
"license": "Apache License 2.0",
"lines": 31,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/portainer/test_switch.py | """Tests for the Portainer switch platform."""
from __future__ import annotations
from unittest.mock import AsyncMock, patch
from pyportainer.exceptions import (
PortainerAuthenticationError,
PortainerConnectionError,
PortainerTimeoutError,
)
import pytest
from syrupy.assertion import SnapshotAssertion
... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/portainer/test_switch.py",
"license": "Apache License 2.0",
"lines": 127,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/prowl/test_config_flow.py | """Test Prowl config flow."""
from unittest.mock import AsyncMock
import prowlpy
from homeassistant import config_entries
from homeassistant.components.prowl.const import DOMAIN
from homeassistant.const import CONF_API_KEY, CONF_NAME
from homeassistant.core import HomeAssistant
from homeassistant.data_entry_flow imp... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/prowl/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 88,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/prowl/test_init.py | """Testing the Prowl initialisation."""
from unittest.mock import AsyncMock
import prowlpy
import pytest
from homeassistant.components import notify
from homeassistant.components.prowl.const import DOMAIN
from homeassistant.config_entries import ConfigEntryState
from homeassistant.core import HomeAssistant
from .co... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/prowl/test_init.py",
"license": "Apache License 2.0",
"lines": 71,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/qbittorrent/test_sensor.py | """Tests for the qBittorrent sensor platform, including errored torrents."""
from unittest.mock import AsyncMock, patch
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
import homeassistant.helpers.entity_registry as er... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/qbittorrent/test_sensor.py",
"license": "Apache License 2.0",
"lines": 22,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/recorder/db_schema_50.py | """Models for SQLAlchemy.
This file contains the model definitions for schema version 50.
It is used to test the schema migration logic.
"""
from __future__ import annotations
from collections.abc import Callable
from datetime import datetime, timedelta
import logging
import time
from typing import Any, Final, Proto... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/recorder/db_schema_50.py",
"license": "Apache License 2.0",
"lines": 755,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/recorder/test_migration_from_schema_50.py | """Test for migration from DB schema version 50."""
import importlib
import sys
import threading
from unittest.mock import patch
import pytest
from pytest_unordered import unordered
from sqlalchemy import create_engine, inspect
from sqlalchemy.orm import Session
from homeassistant.components import recorder
from hom... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/recorder/test_migration_from_schema_50.py",
"license": "Apache License 2.0",
"lines": 324,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/xbox/test_image.py | """Test the Xbox image platform."""
from collections.abc import Generator
from datetime import timedelta
from http import HTTPStatus
from unittest.mock import AsyncMock, patch
from freezegun.api import FrozenDateTimeFactory
import pytest
from pythonxbox.api.provider.people.models import PeopleResponse
import respx
fr... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/xbox/test_image.py",
"license": "Apache License 2.0",
"lines": 110,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/telegram_bot/test_event.py | """Test the telegram bot event platform."""
from syrupy.assertion import SnapshotAssertion
from syrupy.filters import props
from homeassistant.components.telegram_bot.const import (
ATTR_CHAT_ID,
ATTR_MESSAGE,
DOMAIN,
SERVICE_SEND_MESSAGE,
)
from homeassistant.core import HomeAssistant
from tests.com... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/telegram_bot/test_event.py",
"license": "Apache License 2.0",
"lines": 32,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/yardian/test_switch.py | """Validate Yardian switch behavior."""
from __future__ import annotations
from unittest.mock import AsyncMock, patch
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN
from homeassistant.const import (
ATTR_ENTITY_ID,
SERVICE_TURN_OFF,
SER... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/yardian/test_switch.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/yardian/test_binary_sensor.py | """Validate Yardian binary sensor behavior."""
from __future__ import annotations
from unittest.mock import AsyncMock, patch
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.yardian.const import DOMAIN
from homeassistant.const import Platform
from homeassistant.core import ... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/yardian/test_binary_sensor.py",
"license": "Apache License 2.0",
"lines": 40,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/yardian/test_init.py | """Test the initialization of Yardian."""
from unittest.mock import AsyncMock
import pytest
from pyyardian import NetworkException, NotAuthorizedException
from homeassistant.config_entries import ConfigEntryState
from homeassistant.core import HomeAssistant
from . import setup_integration
from tests.common import ... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/yardian/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/victron_remote_monitoring/test_energy.py | """Test the Victron Remote Monitoring energy platform."""
from homeassistant.components.victron_remote_monitoring import energy
from homeassistant.config_entries import ConfigEntryState
from homeassistant.core import HomeAssistant
from tests.common import MockConfigEntry
async def test_energy_solar_forecast(
ha... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/victron_remote_monitoring/test_energy.py",
"license": "Apache License 2.0",
"lines": 32,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/sql/test_services.py | """Tests for the SQL integration services."""
from __future__ import annotations
from pathlib import Path
import sqlite3
from unittest.mock import patch
import pytest
import voluptuous as vol
from voluptuous import MultipleInvalid
from homeassistant.components.recorder import Recorder
from homeassistant.components.... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/sql/test_services.py",
"license": "Apache License 2.0",
"lines": 217,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/xbox/test_media_player.py | """Test the Xbox media_player platform."""
from collections.abc import Generator
from http import HTTPStatus
from typing import Any
from unittest.mock import patch
from httpx import HTTPStatusError, RequestError, TimeoutException
import pytest
from pythonxbox.api.provider.catalog.models import CatalogResponse
from py... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/xbox/test_media_player.py",
"license": "Apache License 2.0",
"lines": 288,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/xbox/test_remote.py | """Test the Xbox remote platform."""
from collections.abc import Generator
from http import HTTPStatus
from unittest.mock import AsyncMock, patch
from httpx import HTTPStatusError, RequestError, TimeoutException
import pytest
from pythonxbox.api.provider.smartglass.models import InputKeyType
from syrupy.assertion imp... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/xbox/test_remote.py",
"license": "Apache License 2.0",
"lines": 277,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/xbox/test_init.py | """Tests for the Xbox integration."""
from datetime import timedelta
from http import HTTPStatus
from unittest.mock import AsyncMock, MagicMock, Mock, patch
from aiohttp import ClientError
from freezegun.api import FrozenDateTimeFactory
from httpx import ConnectTimeout, HTTPStatusError, ProtocolError, RequestError, R... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/xbox/test_init.py",
"license": "Apache License 2.0",
"lines": 204,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/zeroconf/test_repairs.py | """Tests for zeroconf repair issues."""
from unittest.mock import patch
import pytest
from zeroconf import ServiceStateChange
from zeroconf.asyncio import AsyncServiceInfo
from homeassistant.components.homeassistant import DOMAIN as HOMEASSISTANT_DOMAIN
from homeassistant.components.repairs import DOMAIN as REPAIRS_... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/zeroconf/test_repairs.py",
"license": "Apache License 2.0",
"lines": 244,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/xbox/test_binary_sensor.py | """Test the Xbox binary_sensor platform."""
from collections.abc import Generator
from unittest.mock import patch
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.binary_sensor import DOMAIN as BINARY_SENSOR_DOMAIN
from homeassistant.components.xbox.binary_sensor import Xbox... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/xbox/test_binary_sensor.py",
"license": "Apache License 2.0",
"lines": 62,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/xbox/test_sensor.py | """Test the Xbox sensor platform."""
from collections.abc import Generator
from unittest.mock import patch
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
from homeassistant.components.xbox.const import DOMAIN
from homeassistant.compone... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/xbox/test_sensor.py",
"license": "Apache License 2.0",
"lines": 62,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core: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... | {
"repo_id": "home-assistant/core",
"file_path": "tests/helpers/template/helpers.py",
"license": "Apache License 2.0",
"lines": 56,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/unifi/test_light.py | """UniFi Network light platform tests."""
from copy import deepcopy
from unittest.mock import patch
from aiounifi.models.message import MessageKey
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_RGB_COLOR,
DOMAIN as LIGHT_DOM... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/unifi/test_light.py",
"license": "Apache License 2.0",
"lines": 371,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/volvo/test_button.py | """Test Volvo buttons."""
from collections.abc import Awaitable, Callable
from unittest.mock import patch
import pytest
from syrupy.assertion import SnapshotAssertion
from volvocarsapi.api import VolvoCarsApi
from volvocarsapi.models import VolvoApiException, VolvoCarsCommandResult
from homeassistant.components.butt... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/volvo/test_button.py",
"license": "Apache License 2.0",
"lines": 124,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/volvo/test_device_tracker.py | """Test Volvo device tracker."""
from collections.abc import Awaitable, Callable
from unittest.mock import patch
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
... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/volvo/test_device_tracker.py",
"license": "Apache License 2.0",
"lines": 25,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/satel_integra/test_init.py | """Test init of Satel Integra integration."""
from copy import deepcopy
from unittest.mock import AsyncMock
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.alarm_control_panel import DOMAIN as ALARM_PANEL_DOMAIN
from homeassistant.components.binary_sensor import DOMAIN as B... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/satel_integra/test_init.py",
"license": "Apache License 2.0",
"lines": 116,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/solaredge/test_init.py | """Tests for the SolarEdge integration."""
from unittest.mock import AsyncMock, Mock, patch
from aiohttp import ClientError
from homeassistant.components.recorder import Recorder
from homeassistant.components.solaredge.const import CONF_SITE_ID, DOMAIN
from homeassistant.config_entries import ConfigEntryState
from h... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/solaredge/test_init.py",
"license": "Apache License 2.0",
"lines": 127,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/telegram_bot/test_diagnostics.py | """Tests for Telegram bot diagnostics."""
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.telegram_bot.const import DOMAIN
from homeassistant.core import HomeAssistant
from tests.components.diagnostics import get_diagnostics_for_config_entry
from tests.typing import ClientSessionGenerato... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/telegram_bot/test_diagnostics.py",
"license": "Apache License 2.0",
"lines": 18,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/volvo/test_diagnostics.py | """Test Volvo diagnostics."""
from collections.abc import Awaitable, Callable
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.const import CONF_TOKEN
from homeassistant.core import HomeAssistant
from tests.common import MockConfigEntry
from tests.components.diagnostics import get_dia... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/volvo/test_diagnostics.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/recorder/db_schema_48.py | """Models for SQLAlchemy.
This file contains the model definitions for schema version 48.
It is used to test the schema migration logic.
"""
from __future__ import annotations
from collections.abc import Callable
from datetime import datetime, timedelta
import logging
import time
from typing import Any, Final, Self,... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/recorder/db_schema_48.py",
"license": "Apache License 2.0",
"lines": 836,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:homeassistant/components/androidtv/services.py | """Services for Android/Fire TV devices."""
from __future__ import annotations
import voluptuous as vol
from homeassistant.components.media_player import DOMAIN as MEDIA_PLAYER_DOMAIN
from homeassistant.const import ATTR_COMMAND
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers import... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/androidtv/services.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/aosmith/select.py | """The select platform for the A. O. Smith integration."""
from homeassistant.components.select import SelectEntity
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
from . import AOSmithConfigEntry
from .coordinator import AOSmithStatusCoord... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/aosmith/select.py",
"license": "Apache License 2.0",
"lines": 56,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/compit/climate.py | """Module contains the CompitClimate class for controlling climate entities."""
import logging
from typing import Any
from compit_inext_api import Param, Parameter
from compit_inext_api.consts import (
CompitFanMode,
CompitHVACMode,
CompitParameter,
CompitPresetMode,
)
from propcache.api import cached... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/compit/climate.py",
"license": "Apache License 2.0",
"lines": 220,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/compit/config_flow.py | """Config flow for Compit integration."""
from __future__ import annotations
from collections.abc import Mapping
import logging
from typing import Any
from compit_inext_api import CannotConnect, CompitApiConnector, InvalidAuth
import voluptuous as vol
from homeassistant.config_entries import SOURCE_REAUTH, ConfigFl... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/compit/config_flow.py",
"license": "Apache License 2.0",
"lines": 95,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/compit/coordinator.py | """Define an object to manage fetching Compit data."""
from datetime import timedelta
import logging
from compit_inext_api import CompitApiConnector, DeviceInstance
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.update_coordinator import D... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/compit/coordinator.py",
"license": "Apache License 2.0",
"lines": 32,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/cync/config_flow.py | """Config flow for the Cync integration."""
from __future__ import annotations
from collections.abc import Mapping
import logging
from typing import Any
from pycync import Auth
from pycync.exceptions import AuthFailedError, CyncError, TwoFactorRequiredError
import voluptuous as vol
from homeassistant.config_entries... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/cync/config_flow.py",
"license": "Apache License 2.0",
"lines": 124,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/cync/const.py | """Constants for the Cync integration."""
DOMAIN = "cync"
CONF_TWO_FACTOR_CODE = "two_factor_code"
CONF_USER_ID = "user_id"
CONF_AUTHORIZE_STRING = "authorize_string"
CONF_EXPIRES_AT = "expires_at"
CONF_REFRESH_TOKEN = "refresh_token"
| {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/cync/const.py",
"license": "Apache License 2.0",
"lines": 7,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/cync/coordinator.py | """Coordinator to handle keeping device states up to date."""
from __future__ import annotations
from datetime import timedelta
import logging
import time
from pycync import Cync, CyncDevice, User
from pycync.exceptions import AuthFailedError
from homeassistant.config_entries import ConfigEntry
from homeassistant.c... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/cync/coordinator.py",
"license": "Apache License 2.0",
"lines": 65,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/cync/entity.py | """Setup for a generic entity type for the Cync integration."""
from pycync.devices import CyncDevice
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import DOMAIN
from .coordinator import CyncCoordinator
class CyncBase... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/cync/entity.py",
"license": "Apache License 2.0",
"lines": 34,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/cync/light.py | """Support for Cync light entities."""
from typing import Any
from pycync import CyncLight
from pycync.devices.capabilities import CyncCapability
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP_KELVIN,
ATTR_RGB_COLOR,
ColorMode,
LightEntity,
filter_supported_colo... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/cync/light.py",
"license": "Apache License 2.0",
"lines": 151,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/derivative/diagnostics.py | """Diagnostics support for derivative."""
from __future__ import annotations
from typing import Any
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
async def async_get_config_entry_diagnostics(
hass: HomeA... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/derivative/diagnostics.py",
"license": "Apache License 2.0",
"lines": 16,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/droplet/config_flow.py | """Config flow for Droplet integration."""
from __future__ import annotations
from typing import Any
from pydroplet.droplet import DropletConnection, DropletDiscovery
import voluptuous as vol
from homeassistant.config_entries import ConfigFlow, ConfigFlowResult
from homeassistant.const import CONF_CODE, CONF_DEVICE... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/droplet/config_flow.py",
"license": "Apache License 2.0",
"lines": 105,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/droplet/const.py | """Constants for the droplet integration."""
CONNECT_DELAY = 5
DOMAIN = "droplet"
DEVICE_NAME = "Droplet"
KEY_CURRENT_FLOW_RATE = "current_flow_rate"
KEY_VOLUME = "volume"
KEY_SIGNAL_QUALITY = "signal_quality"
KEY_SERVER_CONNECTIVITY = "server_connectivity"
| {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/droplet/const.py",
"license": "Apache License 2.0",
"lines": 8,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/droplet/coordinator.py | """Droplet device data update coordinator object."""
from __future__ import annotations
import asyncio
import logging
import time
from pydroplet.droplet import Droplet
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_CODE, CONF_IP_ADDRESS, CONF_PORT
from homeassistant.core i... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/droplet/coordinator.py",
"license": "Apache License 2.0",
"lines": 66,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.