repo stringlengths 7 90 | file_url stringlengths 81 315 | file_path stringlengths 4 228 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:38:15 2026-01-05 02:33:18 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/fyta/test_config_flow.py | tests/components/fyta/test_config_flow.py | """Test the fyta config flow."""
from unittest.mock import AsyncMock
from fyta_cli.fyta_exceptions import (
FytaAuthentificationError,
FytaConnectionError,
FytaPasswordError,
)
import pytest
from homeassistant import config_entries
from homeassistant.components.fyta.const import CONF_EXPIRATION, DOMAIN
f... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/fyta/const.py | tests/components/fyta/const.py | """Common methods and const used across tests for FYTA."""
USERNAME = "fyta_user"
PASSWORD = "fyta_pass"
ACCESS_TOKEN = "123xyz"
EXPIRATION = "2030-12-31T10:00:00+00:00"
EXPIRATION_OLD = "2020-01-01T00:00:00+00:00"
| python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/fyta/conftest.py | tests/components/fyta/conftest.py | """Test helpers for FYTA."""
from collections.abc import Generator
from datetime import UTC, datetime
from unittest.mock import AsyncMock, MagicMock, patch
from fyta_cli.fyta_models import Credentials, Plant
import pytest
from homeassistant.components.fyta.const import CONF_EXPIRATION, DOMAIN
from homeassistant.cons... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/fyta/test_image.py | tests/components/fyta/test_image.py | """Test the Home Assistant fyta sensor module."""
from datetime import timedelta
from http import HTTPStatus
from unittest.mock import AsyncMock
from freezegun.api import FrozenDateTimeFactory
from fyta_cli.fyta_exceptions import FytaConnectionError, FytaPlantError
from fyta_cli.fyta_models import Plant
import pytest... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/fyta/__init__.py | tests/components/fyta/__init__.py | """Tests for the Fyta integration."""
from unittest.mock import patch
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from tests.common import MockConfigEntry
async def setup_platform(
hass: HomeAssistant, config_entry: MockConfigEntry, platforms: list[Platform]
) -> MockC... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/fyta/test_init.py | tests/components/fyta/test_init.py | """Test the initialization."""
from datetime import UTC, datetime
from unittest.mock import AsyncMock
from fyta_cli.fyta_exceptions import (
FytaAuthentificationError,
FytaConnectionError,
FytaPasswordError,
)
import pytest
from homeassistant.components.fyta.const import CONF_EXPIRATION, DOMAIN
from home... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/pvpc_hourly_pricing/test_config_flow.py | tests/components/pvpc_hourly_pricing/test_config_flow.py | """Tests for the pvpc_hourly_pricing config_flow."""
from datetime import datetime, timedelta
from freezegun.api import FrozenDateTimeFactory
from homeassistant import config_entries
from homeassistant.components.pvpc_hourly_pricing.const import (
ATTR_POWER,
ATTR_POWER_P3,
ATTR_TARIFF,
CONF_USE_API_... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/pvpc_hourly_pricing/conftest.py | tests/components/pvpc_hourly_pricing/conftest.py | """Tests for the pvpc_hourly_pricing integration."""
from http import HTTPStatus
import pytest
from homeassistant.components.pvpc_hourly_pricing.const import ATTR_TARIFF, DOMAIN
from homeassistant.const import ATTR_UNIT_OF_MEASUREMENT, CURRENCY_EURO, UnitOfEnergy
from tests.common import load_fixture
from tests.tes... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/pvpc_hourly_pricing/__init__.py | tests/components/pvpc_hourly_pricing/__init__.py | """Tests for the pvpc_hourly_pricing integration."""
| python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/airly/test_diagnostics.py | tests/components/airly/test_diagnostics.py | """Test Airly diagnostics."""
from syrupy.assertion import SnapshotAssertion
from syrupy.filters import props
from homeassistant.core import HomeAssistant
from . import init_integration
from tests.components.diagnostics import get_diagnostics_for_config_entry
from tests.test_util.aiohttp import AiohttpClientMocker
... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/airly/test_sensor.py | tests/components/airly/test_sensor.py | """Test sensor of Airly integration."""
from datetime import timedelta
from http import HTTPStatus
from unittest.mock import patch
from airly.exceptions import AirlyError
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.airly.const import DOMAIN
from homeassistant.const import ATTR_ENTITY... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/airly/test_system_health.py | tests/components/airly/test_system_health.py | """Test Airly system health."""
import asyncio
from aiohttp import ClientError
from homeassistant.components.airly.const import DOMAIN
from homeassistant.core import HomeAssistant
from homeassistant.setup import async_setup_component
from . import init_integration
from tests.common import get_system_health_info
fr... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/airly/test_config_flow.py | tests/components/airly/test_config_flow.py | """Define tests for the Airly config flow."""
from http import HTTPStatus
from airly.exceptions import AirlyError
from homeassistant.components.airly.const import CONF_USE_NEAREST, DOMAIN
from homeassistant.config_entries import SOURCE_USER
from homeassistant.const import CONF_API_KEY, CONF_LATITUDE, CONF_LONGITUDE,... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/airly/__init__.py | tests/components/airly/__init__.py | """Tests for Airly."""
from homeassistant.components.airly.const import DOMAIN
from homeassistant.core import HomeAssistant
from tests.common import MockConfigEntry, async_load_fixture
from tests.test_util.aiohttp import AiohttpClientMocker
API_NEAREST_URL = "https://airapi.airly.eu/v2/measurements/nearest?lat=123.0... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/airly/test_init.py | tests/components/airly/test_init.py | """Test init of Airly integration."""
from typing import Any
from freezegun.api import FrozenDateTimeFactory
import pytest
from homeassistant.components.air_quality import DOMAIN as AIR_QUALITY_PLATFORM
from homeassistant.components.airly.const import DOMAIN
from homeassistant.components.airly.coordinator import set... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/risco/test_binary_sensor.py | tests/components/risco/test_binary_sensor.py | """Tests for the Risco binary sensors."""
from collections.abc import Callable
from typing import Any
from unittest.mock import MagicMock, PropertyMock, patch
import pytest
from homeassistant.components.risco import CannotConnectError, UnauthorizedError
from homeassistant.components.risco.const import DOMAIN
from ho... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/risco/test_sensor.py | tests/components/risco/test_sensor.py | """Tests for the Risco event sensors."""
from datetime import timedelta
from unittest.mock import MagicMock, PropertyMock, patch
import pytest
from homeassistant.components.risco import CannotConnectError, UnauthorizedError
from homeassistant.components.risco.coordinator import LAST_EVENT_TIMESTAMP_KEY
from homeassi... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/risco/test_switch.py | tests/components/risco/test_switch.py | """Tests for the Risco binary sensors."""
from collections.abc import Callable
from typing import Any
from unittest.mock import PropertyMock, patch
import pytest
from homeassistant.components.risco import CannotConnectError, UnauthorizedError
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN
from h... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/risco/util.py | tests/components/risco/util.py | """Utilities for Risco tests."""
from unittest.mock import AsyncMock, MagicMock
TEST_SITE_UUID = "test-site-uuid"
TEST_SITE_NAME = "test-site-name"
def zone_mock():
"""Return a mocked zone."""
return MagicMock(
triggered=False, bypassed=False, bypass=AsyncMock(return_value=True)
)
def system_m... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/risco/test_alarm_control_panel.py | tests/components/risco/test_alarm_control_panel.py | """Tests for the Risco alarm control panel device."""
from collections.abc import Callable
from typing import Any
from unittest.mock import AsyncMock, MagicMock, PropertyMock, patch
import pytest
from homeassistant.components.alarm_control_panel import (
DOMAIN as ALARM_DOMAIN,
AlarmControlPanelEntityFeature... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | true |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/risco/test_config_flow.py | tests/components/risco/test_config_flow.py | """Test the Risco config flow."""
from unittest.mock import PropertyMock, patch
import pytest
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.components.risco.config_flow import (
CannotConnectError,
UnauthorizedError,
)
from homeassistant.components.risco.const import CO... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/risco/test_services.py | tests/components/risco/test_services.py | """Tests for the Risco services."""
from datetime import datetime
from unittest.mock import patch
import pytest
from homeassistant.components.risco import DOMAIN
from homeassistant.components.risco.const import SERVICE_SET_TIME
from homeassistant.config_entries import ConfigEntryState
from homeassistant.const import... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/risco/conftest.py | tests/components/risco/conftest.py | """Fixtures for Risco tests."""
from collections.abc import AsyncGenerator
from typing import Any
from unittest.mock import MagicMock, PropertyMock, patch
from pyrisco.cloud.event import Event
import pytest
from homeassistant.components.risco.const import DOMAIN, TYPE_LOCAL
from homeassistant.const import (
CONF... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/risco/__init__.py | tests/components/risco/__init__.py | """Tests for the Risco integration."""
| python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/risco/test_init.py | tests/components/risco/test_init.py | """Tests for the Risco integration."""
from unittest.mock import patch
import pytest
from homeassistant.core import HomeAssistant
@pytest.fixture
def mock_error_handler():
"""Create a mock for add_error_handler."""
with patch("homeassistant.components.risco.RiscoLocal.add_error_handler") as mock:
y... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/ukraine_alarm/test_config_flow.py | tests/components/ukraine_alarm/test_config_flow.py | """Test the Ukraine Alarm config flow."""
from collections.abc import Generator
from unittest.mock import AsyncMock, patch
from aiohttp import ClientConnectionError, ClientError, ClientResponseError, RequestInfo
import pytest
from yarl import URL
from homeassistant import config_entries
from homeassistant.components... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/ukraine_alarm/__init__.py | tests/components/ukraine_alarm/__init__.py | """Tests for the Ukraine Alarm integration."""
def _region(rid, recurse=0, depth=0):
"""Create a test region with optional nested structure."""
if depth == 0:
name_prefix = "State"
elif depth == 1:
name_prefix = "District"
else:
name_prefix = "Community"
name = f"{name_pre... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/ukraine_alarm/test_init.py | tests/components/ukraine_alarm/test_init.py | """Test the Ukraine Alarm integration initialization."""
from unittest.mock import patch
from homeassistant.components.ukraine_alarm.const import DOMAIN
from homeassistant.core import HomeAssistant
from homeassistant.helpers import issue_registry as ir
from . import REGIONS
from tests.common import MockConfigEntry
... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/device_tracker/test_legacy.py | tests/components/device_tracker/test_legacy.py | """Tests for the legacy device tracker component."""
from unittest.mock import mock_open, patch
from homeassistant.components.device_tracker import legacy
from homeassistant.core import HomeAssistant
from homeassistant.util.yaml import dump
from tests.common import patch_yaml_files
def test_remove_device_from_conf... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/device_tracker/common.py | tests/components/device_tracker/common.py | """Collection of helper methods.
All containing methods are legacy helpers that should not be used by new
components. Instead call the service directly.
"""
from homeassistant.components.device_tracker import (
ATTR_ATTRIBUTES,
ATTR_BATTERY,
ATTR_DEV_ID,
ATTR_GPS,
ATTR_HOST_NAME,
ATTR_LOCATION... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/device_tracker/test_device_trigger.py | tests/components/device_tracker/test_device_trigger.py | """The tests for Device Tracker device triggers."""
import pytest
from pytest_unordered import unordered
import voluptuous_serialize
from homeassistant.components import automation, zone
from homeassistant.components.device_automation import DeviceAutomationType
from homeassistant.components.device_tracker import DOM... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/device_tracker/test_device_condition.py | tests/components/device_tracker/test_device_condition.py | """The tests for Device tracker device conditions."""
import pytest
from pytest_unordered import unordered
from homeassistant.components import automation
from homeassistant.components.device_automation import DeviceAutomationType
from homeassistant.components.device_tracker import DOMAIN
from homeassistant.const imp... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/device_tracker/__init__.py | tests/components/device_tracker/__init__.py | """The tests for Device tracker platforms."""
| python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/device_tracker/test_init.py | tests/components/device_tracker/test_init.py | """The tests for the device tracker component."""
from collections.abc import Generator
from datetime import datetime, timedelta
import json
import logging
import os
from unittest.mock import call, patch
import pytest
from homeassistant.components import device_tracker, zone
from homeassistant.components.device_trac... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/device_tracker/test_trigger.py | tests/components/device_tracker/test_trigger.py | """Test device_tracker trigger."""
from collections.abc import Generator
from unittest.mock import patch
import pytest
from homeassistant.const import (
ATTR_LABEL_ID,
CONF_ENTITY_ID,
STATE_HOME,
STATE_NOT_HOME,
)
from homeassistant.core import HomeAssistant, ServiceCall
from tests.components import... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/device_tracker/test_config_entry.py | tests/components/device_tracker/test_config_entry.py | """Test Device Tracker config entry things."""
from collections.abc import Generator
from typing import Any
import pytest
from homeassistant.components.device_tracker import (
ATTR_HOST_NAME,
ATTR_IP,
ATTR_MAC,
ATTR_SOURCE_TYPE,
DOMAIN,
SourceType,
)
from homeassistant.components.device_track... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/nederlandse_spoorwegen/test_diagnostics.py | tests/components/nederlandse_spoorwegen/test_diagnostics.py | """Tests for the diagnostics data provided by the Nederlandse Spoorwegen integration."""
from unittest.mock import AsyncMock
import pytest
from syrupy.assertion import SnapshotAssertion
from syrupy.filters import props
from homeassistant.components.nederlandse_spoorwegen.const import DOMAIN
from homeassistant.core i... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/nederlandse_spoorwegen/test_binary_sensor.py | 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, ... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/nederlandse_spoorwegen/test_sensor.py | tests/components/nederlandse_spoorwegen/test_sensor.py | """Test the Nederlandse Spoorwegen 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.components.nederlandse_spoorwegen.c... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/nederlandse_spoorwegen/test_config_flow.py | tests/components/nederlandse_spoorwegen/test_config_flow.py | """Test config flow for Nederlandse Spoorwegen integration."""
from datetime import time
from typing import Any
from unittest.mock import AsyncMock
import pytest
from requests import ConnectionError as RequestsConnectionError, HTTPError, Timeout
from homeassistant.components.nederlandse_spoorwegen.const import (
... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/nederlandse_spoorwegen/const.py | tests/components/nederlandse_spoorwegen/const.py | """Constants for the Nederlandse Spoorwegen integration tests."""
API_KEY = "abc1234567"
# Date/time format strings
DATETIME_FORMAT_LENGTH = 16 # "DD-MM-YYYY HH:MM" format
DATE_SEPARATOR = "-"
DATETIME_SPACE = " "
TIME_SEPARATOR = ":"
# Test route names
TEST_ROUTE_TITLE_1 = "Route 1"
TEST_ROUTE_TITLE_2 = "Route 2"
... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/nederlandse_spoorwegen/conftest.py | tests/components/nederlandse_spoorwegen/conftest.py | """Fixtures for Nederlandse Spoorwegen tests."""
from collections.abc import Generator
from unittest.mock import AsyncMock, patch
from ns_api import Station, Trip
import pytest
from homeassistant.components.nederlandse_spoorwegen.const import (
CONF_FROM,
CONF_TIME,
CONF_TO,
CONF_VIA,
DOMAIN,
... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/nederlandse_spoorwegen/__init__.py | tests/components/nederlandse_spoorwegen/__init__.py | """Tests for the Nederlandse Spoorwegen integration."""
from homeassistant.core import HomeAssistant
from tests.common import MockConfigEntry
async def setup_integration(hass: HomeAssistant, config_entry: MockConfigEntry) -> None:
"""Set up the component."""
config_entry.add_to_hass(hass)
await hass.co... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/nederlandse_spoorwegen/test_init.py | 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: ... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/wiz/test_diagnostics.py | tests/components/wiz/test_diagnostics.py | """Test WiZ diagnostics."""
from syrupy.assertion import SnapshotAssertion
from homeassistant.core import HomeAssistant
from . import async_setup_integration
from tests.components.diagnostics import get_diagnostics_for_config_entry
from tests.typing import ClientSessionGenerator
async def test_diagnostics(
ha... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/wiz/test_binary_sensor.py | tests/components/wiz/test_binary_sensor.py | """Tests for WiZ binary_sensor platform."""
from homeassistant.components import wiz
from homeassistant.components.wiz.binary_sensor import OCCUPANCY_UNIQUE_ID
from homeassistant.config_entries import ConfigEntryState
from homeassistant.const import CONF_HOST, STATE_OFF, STATE_ON, STATE_UNKNOWN, Platform
from homeassi... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/wiz/test_sensor.py | tests/components/wiz/test_sensor.py | """Tests for the sensor platform."""
from unittest.mock import AsyncMock
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from . import (
FAKE_DUAL_HEAD_RGBWW_BULB,
FAKE_MAC,
FAKE_SOCKET_WITH_POWER_MONITORING,
_mocked_wizlight,
_patch_discovery,... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/wiz/test_switch.py | tests/components/wiz/test_switch.py | """Tests for switch platform."""
import datetime
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN
from homeassistant.const import (
ATTR_ENTITY_ID,
SERVICE_TURN_OFF,
SERVICE_TURN_ON,
STATE_OFF,
STATE_ON,
STATE_UNAVAILABLE,
)
from homeassistant.core import HomeAssistant
from ... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/wiz/test_fan.py | tests/components/wiz/test_fan.py | """Tests for fan platform."""
from typing import Any
from unittest.mock import patch
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.fan import (
ATTR_DIRECTION,
ATTR_PERCENTAGE,
ATTR_PRESET_MODE,
DIRECTION_FORWARD,
DIRECTION_REVERSE,
DOMAIN as FAN_DOMAIN,
SER... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/wiz/test_config_flow.py | tests/components/wiz/test_config_flow.py | """Test the WiZ Platform config flow."""
from unittest.mock import AsyncMock, patch
import pytest
from pywizlight.exceptions import WizLightConnectionError, WizLightTimeOutError
from homeassistant import config_entries
from homeassistant.components.wiz.config_flow import CONF_DEVICE
from homeassistant.components.wiz... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/wiz/__init__.py | tests/components/wiz/__init__.py | """Tests for the WiZ Platform integration."""
from collections.abc import Callable, Generator
from contextlib import _GeneratorContextManager, contextmanager
from copy import deepcopy
import json
from typing import Any
from unittest.mock import AsyncMock, MagicMock, patch
from pywizlight import SCENES, BulbType, Pilo... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/wiz/test_number.py | tests/components/wiz/test_number.py | """Tests for the number platform."""
from homeassistant.components.number import (
ATTR_VALUE,
DOMAIN as NUMBER_DOMAIN,
SERVICE_SET_VALUE,
)
from homeassistant.const import ATTR_ENTITY_ID, STATE_UNAVAILABLE
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/wiz/test_light.py | tests/components/wiz/test_light.py | """Tests for light platform."""
from pywizlight import PilotBuilder
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_MODE,
ATTR_COLOR_TEMP_KELVIN,
ATTR_EFFECT,
ATTR_RGBW_COLOR,
ATTR_RGBWW_COLOR,
DOMAIN as LIGHT_DOMAIN,
)
from homeassistant.const import (
ATTR_EN... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/wiz/test_init.py | tests/components/wiz/test_init.py | """Tests for wiz integration."""
import datetime
from unittest.mock import AsyncMock, patch
from homeassistant.components.wiz.const import DOMAIN
from homeassistant.config_entries import ConfigEntryState
from homeassistant.const import ATTR_FRIENDLY_NAME, CONF_HOST, EVENT_HOMEASSISTANT_STOP
from homeassistant.core im... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/devolo_home_network/test_button.py | tests/components/devolo_home_network/test_button.py | """Tests for the devolo Home Network buttons."""
from unittest.mock import AsyncMock
from devolo_plc_api.exceptions.device import DevicePasswordProtected, DeviceUnavailable
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.button import DOMAIN as PLATFORM, SERVICE_PRESS
from ... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/devolo_home_network/test_diagnostics.py | tests/components/devolo_home_network/test_diagnostics.py | """Tests for the devolo Home Network diagnostics."""
from __future__ import annotations
import pytest
from syrupy.assertion import SnapshotAssertion
from syrupy.filters import props
from homeassistant.config_entries import ConfigEntryState
from homeassistant.core import HomeAssistant
from . import configure_integra... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/devolo_home_network/test_binary_sensor.py | tests/components/devolo_home_network/test_binary_sensor.py | """Tests for the devolo Home Network sensors."""
from unittest.mock import AsyncMock
from devolo_plc_api.exceptions.device import DeviceUnavailable
from freezegun.api import FrozenDateTimeFactory
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.binary_sensor import DOMAIN as... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/devolo_home_network/test_sensor.py | tests/components/devolo_home_network/test_sensor.py | """Tests for the devolo Home Network sensors."""
from datetime import timedelta
from unittest.mock import AsyncMock
from devolo_plc_api.exceptions.device import DevicePasswordProtected, DeviceUnavailable
from freezegun.api import FrozenDateTimeFactory
import pytest
from syrupy.assertion import SnapshotAssertion
from... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/devolo_home_network/test_switch.py | tests/components/devolo_home_network/test_switch.py | """Tests for the devolo Home Network switch."""
from datetime import timedelta
from unittest.mock import AsyncMock
from devolo_plc_api.device_api import WifiGuestAccessGet
from devolo_plc_api.exceptions.device import DevicePasswordProtected, DeviceUnavailable
from freezegun.api import FrozenDateTimeFactory
import pyt... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/devolo_home_network/test_config_flow.py | tests/components/devolo_home_network/test_config_flow.py | """Test the devolo Home Network config flow."""
from __future__ import annotations
from typing import Any
from unittest.mock import patch
from devolo_plc_api.exceptions.device import DeviceNotFound, DevicePasswordProtected
import pytest
from homeassistant import config_entries
from homeassistant.components.devolo_h... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/devolo_home_network/const.py | tests/components/devolo_home_network/const.py | """Constants used for mocking data."""
from ipaddress import ip_address
from devolo_plc_api.device_api import (
UPDATE_AVAILABLE,
WIFI_BAND_2G,
WIFI_BAND_5G,
WIFI_VAP_MAIN_AP,
ConnectedStationInfo,
NeighborAPInfo,
UpdateFirmwareCheck,
WifiGuestAccessGet,
)
from devolo_plc_api.plcnet_ap... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/devolo_home_network/mock.py | tests/components/devolo_home_network/mock.py | """Mock of a devolo Home Network device."""
from __future__ import annotations
from unittest.mock import AsyncMock
from devolo_plc_api.device import Device
from devolo_plc_api.device_api.deviceapi import DeviceApi
from devolo_plc_api.exceptions.device import DevicePasswordProtected
from devolo_plc_api.plcnet_api.plc... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/devolo_home_network/conftest.py | tests/components/devolo_home_network/conftest.py | """Fixtures for tests."""
from itertools import cycle
from unittest.mock import MagicMock, patch
import pytest
from .const import DISCOVERY_INFO, IP
from .mock import MockDevice
@pytest.fixture
def mock_device():
"""Mock connecting to a devolo home network device."""
device = MockDevice(ip=IP)
with pat... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/devolo_home_network/test_image.py | tests/components/devolo_home_network/test_image.py | """Tests for the devolo Home Network images."""
from http import HTTPStatus
from unittest.mock import AsyncMock
from devolo_plc_api.exceptions.device import DeviceUnavailable
from freezegun.api import FrozenDateTimeFactory
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.dev... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/devolo_home_network/__init__.py | tests/components/devolo_home_network/__init__.py | """Tests for the devolo Home Network integration."""
from homeassistant.components.devolo_home_network.const import DOMAIN
from homeassistant.const import CONF_IP_ADDRESS, CONF_PASSWORD
from homeassistant.core import HomeAssistant
from .const import DISCOVERY_INFO, IP
from tests.common import MockConfigEntry
def c... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/devolo_home_network/test_device_tracker.py | tests/components/devolo_home_network/test_device_tracker.py | """Tests for the devolo Home Network device tracker."""
from unittest.mock import AsyncMock
from devolo_plc_api.exceptions.device import DeviceUnavailable
from freezegun.api import FrozenDateTimeFactory
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.device_tracker import D... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/devolo_home_network/test_update.py | tests/components/devolo_home_network/test_update.py | """Tests for the devolo Home Network update."""
from devolo_plc_api.device_api import UPDATE_NOT_AVAILABLE, UpdateFirmwareCheck
from devolo_plc_api.exceptions.device import DevicePasswordProtected, DeviceUnavailable
from freezegun.api import FrozenDateTimeFactory
import pytest
from syrupy.assertion import SnapshotAsse... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/devolo_home_network/test_init.py | tests/components/devolo_home_network/test_init.py | """Test the devolo Home Network integration setup."""
from unittest.mock import patch
from devolo_plc_api.exceptions.device import DeviceNotFound
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.binary_sensor import DOMAIN as BINARY_SENSOR
from homeassistant.components.butto... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/ourgroceries/test_todo.py | tests/components/ourgroceries/test_todo.py | """Unit tests for the OurGroceries todo platform."""
from unittest.mock import AsyncMock
from aiohttp import ClientError
from freezegun.api import FrozenDateTimeFactory
import pytest
from homeassistant.components.ourgroceries.coordinator import SCAN_INTERVAL
from homeassistant.components.todo import (
ATTR_ITEM,... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/ourgroceries/test_config_flow.py | tests/components/ourgroceries/test_config_flow.py | """Test the OurGroceries config flow."""
from unittest.mock import AsyncMock, patch
import pytest
from homeassistant import config_entries
from homeassistant.components.ourgroceries.config_flow import (
ClientError,
InvalidLoginException,
)
from homeassistant.components.ourgroceries.const import DOMAIN
from ... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/ourgroceries/conftest.py | tests/components/ourgroceries/conftest.py | """Common fixtures for the OurGroceries tests."""
from collections.abc import Generator
from unittest.mock import AsyncMock, patch
import pytest
from homeassistant.components.ourgroceries import DOMAIN
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from homeassistant.core import HomeAssistant
from home... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/ourgroceries/__init__.py | tests/components/ourgroceries/__init__.py | """Tests for the OurGroceries integration."""
from typing import Any
def items_to_shopping_list(
items: list, version_id: str = "1"
) -> dict[str, dict[str, Any]]:
"""Convert a list of items into a shopping list."""
return {"list": {"versionId": version_id, "items": items}}
| python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/ourgroceries/test_init.py | tests/components/ourgroceries/test_init.py | """Unit tests for the OurGroceries integration."""
from unittest.mock import AsyncMock
import pytest
from homeassistant.components.ourgroceries import ClientError, InvalidLoginException
from homeassistant.components.ourgroceries.const import DOMAIN
from homeassistant.config_entries import ConfigEntryState
from homea... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/soma/test_config_flow.py | tests/components/soma/test_config_flow.py | """Tests for the Soma config flow."""
from unittest.mock import patch
from api.soma_api import SomaApi
from requests import RequestException
from homeassistant.components.soma import DOMAIN
from homeassistant.config_entries import SOURCE_IMPORT, SOURCE_USER
from homeassistant.core import HomeAssistant
from homeassis... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/soma/__init__.py | tests/components/soma/__init__.py | """Tests for the Soma component."""
| python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/smarttub/test_binary_sensor.py | tests/components/smarttub/test_binary_sensor.py | """Test the SmartTub binary sensor platform."""
from datetime import datetime
from unittest.mock import create_autospec
import pytest
import smarttub
from homeassistant.components.binary_sensor import STATE_OFF, STATE_ON
from homeassistant.core import HomeAssistant
async def test_binary_sensors(spa, setup_entry, h... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/smarttub/test_sensor.py | tests/components/smarttub/test_sensor.py | """Test the SmartTub sensor platform."""
import pytest
import smarttub
from homeassistant.const import STATE_UNKNOWN
from homeassistant.core import HomeAssistant
@pytest.mark.parametrize(
("entity_suffix", "expected_state"),
[
("state", "normal"),
("flow_switch", "open"),
("ozone", "... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/smarttub/test_switch.py | tests/components/smarttub/test_switch.py | """Test the SmartTub switch platform."""
import pytest
from homeassistant.const import STATE_OFF, STATE_ON
from homeassistant.core import HomeAssistant
@pytest.mark.parametrize(
("pump_id", "entity_suffix", "pump_state"),
[
("CP", "circulation_pump", "off"),
("P1", "jet_p1", "off"),
... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/smarttub/test_climate.py | tests/components/smarttub/test_climate.py | """Test the SmartTub climate platform."""
import smarttub
from homeassistant.components.climate import (
ATTR_CURRENT_TEMPERATURE,
ATTR_HVAC_ACTION,
ATTR_HVAC_MODE,
ATTR_HVAC_MODES,
ATTR_MAX_TEMP,
ATTR_MIN_TEMP,
ATTR_PRESET_MODE,
ATTR_PRESET_MODES,
DOMAIN as CLIMATE_DOMAIN,
PRE... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/smarttub/test_config_flow.py | tests/components/smarttub/test_config_flow.py | """Test the smarttub config flow."""
from unittest.mock import patch
from smarttub import LoginFailed
from homeassistant import config_entries
from homeassistant.components.smarttub.const import DOMAIN
from homeassistant.const import CONF_EMAIL, CONF_PASSWORD
from homeassistant.core import HomeAssistant
from homeass... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/smarttub/conftest.py | tests/components/smarttub/conftest.py | """Common fixtures for smarttub tests."""
from typing import Any
from unittest.mock import create_autospec, patch
import pytest
import smarttub
from homeassistant.components.smarttub.const import DOMAIN
from homeassistant.const import CONF_EMAIL, CONF_PASSWORD
from homeassistant.core import HomeAssistant
from homeas... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/smarttub/__init__.py | tests/components/smarttub/__init__.py | """Tests for the smarttub integration."""
from datetime import timedelta
from homeassistant.components.smarttub.const import SCAN_INTERVAL
from homeassistant.core import HomeAssistant
from homeassistant.util import dt as dt_util
from tests.common import async_fire_time_changed
async def trigger_update(hass: HomeAs... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/smarttub/test_light.py | tests/components/smarttub/test_light.py | """Test the SmartTub light platform."""
import pytest
from smarttub import SpaLight
from homeassistant.core import HomeAssistant
# the light in light_zone should have initial state light_state. we will call
# service_name with service_params, and expect the resultant call to
# SpaLight.set_mode to have set_mode_arg... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/smarttub/test_init.py | tests/components/smarttub/test_init.py | """Test smarttub setup process."""
from unittest.mock import patch
from smarttub import LoginFailed
from homeassistant.components.smarttub.const import DOMAIN
from homeassistant.config_entries import SOURCE_REAUTH, ConfigEntryState
from homeassistant.core import HomeAssistant
from homeassistant.setup import async_se... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/qld_bushfire/test_geo_location.py | tests/components/qld_bushfire/test_geo_location.py | """The tests for the Queensland Bushfire Alert Feed platform."""
import datetime
from unittest.mock import MagicMock, call, patch
from freezegun.api import FrozenDateTimeFactory
from georss_qld_bushfire_alert_client import QldBushfireAlertFeed
from homeassistant.components import geo_location
from homeassistant.comp... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/qld_bushfire/__init__.py | tests/components/qld_bushfire/__init__.py | """Tests for the qld_bushfire component."""
| python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/vivotek/test_config_flow.py | tests/components/vivotek/test_config_flow.py | """Tests for the Vivotek config flow."""
from unittest.mock import AsyncMock
from libpyvivotek.vivotek import VivotekCameraError
import pytest
from homeassistant.components.vivotek.camera import DEFAULT_FRAMERATE, DEFAULT_NAME
from homeassistant.components.vivotek.const import (
CONF_FRAMERATE,
CONF_SECURITY... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/vivotek/conftest.py | tests/components/vivotek/conftest.py | """Fixtures for Vivotek component tests."""
from collections.abc import Generator
from unittest.mock import AsyncMock, patch
import pytest
from homeassistant.components.vivotek import CONF_SECURITY_LEVEL
from homeassistant.components.vivotek.const import (
CONF_FRAMERATE,
CONF_STREAM_PATH,
DOMAIN,
)
from... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/vivotek/__init__.py | tests/components/vivotek/__init__.py | """Tests for Vivotek camera component."""
from homeassistant.core import HomeAssistant
from tests.common import MockConfigEntry
async def setup_integration(hass: HomeAssistant, config_entry: MockConfigEntry) -> None:
"""Fixture for setting up the component."""
config_entry.add_to_hass(hass)
await hass.c... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/vivotek/test_camera.py | tests/components/vivotek/test_camera.py | """Tests for the Vivotek camera integration."""
from unittest.mock import AsyncMock, patch
from syrupy.assertion import SnapshotAssertion
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from . import setup_integration
from tests.common import MockConfigEntry, sn... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/caldav/test_todo.py | tests/components/caldav/test_todo.py | """The tests for the webdav todo component."""
from datetime import UTC, date, datetime
from typing import Any
from unittest.mock import MagicMock, Mock
from caldav.lib.error import DAVError, NotFoundError
from caldav.objects import Todo
import pytest
from homeassistant.components.todo import (
ATTR_DESCRIPTION,... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/caldav/test_config_flow.py | tests/components/caldav/test_config_flow.py | """Test the CalDAV config flow."""
from collections.abc import Generator
from unittest.mock import AsyncMock, Mock, patch
from caldav.lib.error import AuthorizationError, DAVError
import pytest
import requests
from homeassistant import config_entries
from homeassistant.components.caldav.const import DOMAIN
from home... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/caldav/test_calendar.py | tests/components/caldav/test_calendar.py | """The tests for the webdav calendar component."""
from collections.abc import Awaitable, Callable
import datetime
from http import HTTPStatus
from typing import Any
from unittest.mock import MagicMock, Mock
import zoneinfo
from caldav.objects import Event
from freezegun.api import FrozenDateTimeFactory
import pytest... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | true |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/caldav/conftest.py | tests/components/caldav/conftest.py | """Test fixtures for caldav."""
from unittest.mock import Mock, patch
import pytest
from homeassistant.components.caldav.const import DOMAIN
from homeassistant.const import (
CONF_PASSWORD,
CONF_URL,
CONF_USERNAME,
CONF_VERIFY_SSL,
Platform,
)
from tests.common import MockConfigEntry
TEST_URL =... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/caldav/__init__.py | tests/components/caldav/__init__.py | """Tests for the caldav component."""
| python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/caldav/test_init.py | tests/components/caldav/test_init.py | """Unit tests for the CalDav integration."""
from unittest.mock import patch
from caldav.lib.error import AuthorizationError, DAVError
import pytest
import requests
from homeassistant.config_entries import ConfigEntryState
from homeassistant.core import HomeAssistant
from tests.common import MockConfigEntry
@pyte... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/intent_script/__init__.py | tests/components/intent_script/__init__.py | """Tests for the intent_script component."""
| python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/intent_script/test_init.py | tests/components/intent_script/test_init.py | """Test intent_script component."""
from unittest.mock import patch
from homeassistant import config as hass_config
from homeassistant.components.intent_script import DOMAIN
from homeassistant.const import ATTR_FRIENDLY_NAME, SERVICE_RELOAD
from homeassistant.core import HomeAssistant
from homeassistant.helpers impor... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/whois/test_diagnostics.py | tests/components/whois/test_diagnostics.py | """Tests for the diagnostics data provided by the Whois integration."""
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 ClientSession... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/tests/components/whois/test_sensor.py | tests/components/whois/test_sensor.py | """Tests for the sensors provided by the Whois integration."""
from unittest.mock import MagicMock
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.whois.const import SCAN_INTERVAL
from homeassistant.const import STATE_UNKNOWN
from homeassistant.core import HomeAssistant
fro... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.