repo_id stringclasses 409
values | prefix large_stringlengths 34 36.3k | target large_stringlengths 1 498 | assertion_type stringclasses 31
values | difficulty stringclasses 8
values | test_file stringlengths 10 121 | test_function stringlengths 1 104 | test_class stringlengths 0 51 | lineno int32 2 11.3k | commit_idx int32 |
|---|---|---|---|---|---|---|---|---|---|
SukramJ/homematicip_local | from __future__ import annotations
import asyncio
from typing import cast
import pytest
from aiohomematic.model.hub import SysvarDpSwitch
from homeassistant.const import STATE_OFF, STATE_ON
from tests import const, helper
from tests.helper import Factory
TEST_DEVICES: dict[str, str] = {
"VCU2128127": "HmIP-BSM... | STATE_ON | assert | variable | tests/test_switch.py | test_switch | TestCeSwitch | 45 | null |
SukramJ/homematicip_local | from __future__ import annotations
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from aiohomematic.interfaces import ClimateWeekProfileDataPointProtocol, WeekProfileDataPointProtocol
from custom_components.homematicip_local.const import DOMAIN, HmipLocalServices
from homeassistant.core import H... | HomeAssistantError, match="does not support schedules") | pytest.raises | complex_expr | tests/test_set_schedule_service.py | test_get_schedule_raises_if_no_wp_dp | TestGetScheduleHandler | 100 | null |
SukramJ/homematicip_local | from __future__ import annotations
import asyncio
from typing import cast
import pytest
from aiohomematic.model.hub import SysvarDpSwitch
from homeassistant.const import STATE_OFF, STATE_ON
from tests import const, helper
from tests.helper import Factory
TEST_DEVICES: dict[str, str] = {
"VCU2128127": "HmIP-BSM... | STATE_OFF | assert | variable | tests/test_switch.py | test_hmsysvarswitch | TestSysvarDpSwitch | 77 | null |
SukramJ/homematicip_local | from __future__ import annotations
from dataclasses import dataclass
import json
from typing import Any
from unittest.mock import AsyncMock, Mock, patch
import pytest
from pytest_homeassistant_custom_component.common import MockConfigEntry
import pytest_socket
from aiohomematic.central.coordinators import (
Conf... | 1 | assert | numeric_literal | tests/test_websocket_api.py | test_list_devices | TestWsListDevices | 197 | null |
SukramJ/homematicip_local | from __future__ import annotations
from typing import Any
from unittest.mock import AsyncMock, MagicMock, Mock, patch
import pytest
from custom_components.homematicip_local.light import (
ATTR_CHANNEL_BRIGHTNESS,
ATTR_CHANNEL_COLOR,
ATTR_COLOR,
ATTR_LAST_BRIGHTNESS,
AioHomematicLight,
async_s... | 2 | assert | numeric_literal | tests/test_light.py | test_turn_on_all_kwargs | TestAioHomematicLightTurnOn | 475 | null |
SukramJ/homematicip_local | from __future__ import annotations
import pytest
class TestCCUDataEdgeCases:
def test_midnight_boundary_handling(self) -> None:
"""
Test how midnight (00:00 and 24:00) is handled.
24:00 is represented as 1440 minutes in CCU format.
"""
midnight_start = 0 # 00:00 = 0 minu... | 0 | assert | numeric_literal | tests/test_schedule_ccu_raw_data.py | test_midnight_boundary_handling | TestCCUDataEdgeCases | 296 | null |
SukramJ/homematicip_local | from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from typing import Any
from unittest.mock import AsyncMock
import pytest
import custom_components.homematicip_local.services as hm_services
from homeassistant.core import HomeAssistant
class TestAsyncSetupServi... | {"p": 1} | assert | collection | tests/test_services.py | test_registers_and_dispatches_all | TestAsyncSetupServices | 157 | null |
SukramJ/homematicip_local | from __future__ import annotations
from typing import Any
from unittest.mock import AsyncMock, patch
import pytest
from pytest_homeassistant_custom_component.common import MockConfigEntry
from aiohomematic.backend_detection import BackendDetectionResult
from aiohomematic.const import (
CONF_PASSWORD,
CONF_US... | True | assert | bool_literal | tests/test_config_flow.py | test_form_https_redirect_enables_tls | TestConfigFlowForm | 365 | null |
SukramJ/homematicip_local | from __future__ import annotations
from aiohomematic.const import DataPointCategory
from custom_components.homematicip_local.entity_helpers import REGISTRY
class TestEntityHelper:
def test_registry_has_rules(self) -> None:
"""Test that the registry has rules registered."""
stats = REGISTRY.get_st... | 10 | assert | numeric_literal | tests/test_entity_helper.py | test_registry_has_rules | TestEntityHelper | 88 | null |
SukramJ/homematicip_local | from __future__ import annotations
import pytest
from pytest_homeassistant_custom_component.components.recorder.common import async_wait_recording_done
from aiohomematic.const import DeviceFirmwareState
from custom_components.homematicip_local.const import EVENT_ADDRESS, EVENT_INTERFACE_ID, EVENT_MODEL
from custom_co... | "HmIP-BSM" | assert | string_literal | tests/test_recorder.py | no_test_event_entity_un_recorded | TestRecorder | 55 | null |
SukramJ/homematicip_local | from __future__ import annotations
from aiohomematic.const import DataPointCategory
from custom_components.homematicip_local.entity_helpers import REGISTRY
class TestEntityHelper:
def test_registry_find_cover(self) -> None:
"""Test finding a cover description."""
description = REGISTRY.find(
... | "BLIND" | assert | string_literal | tests/test_entity_helper.py | test_registry_find_cover | TestEntityHelper | 42 | null |
SukramJ/homematicip_local | from __future__ import annotations
from types import SimpleNamespace
import voluptuous as vol
from aiohomematic.const import IDENTIFIER_SEPARATOR
from custom_components.homematicip_local.const import EVENT_CHANNEL_NO, EVENT_PARAMETER
from custom_components.homematicip_local.support import (
cleanup_click_event_d... | None | assert | none_literal | tests/test_support.py | test_returns_none_without_separator | TestGetDeviceAddressAtInterfaceFromIdentifiers | 91 | null |
SukramJ/homematicip_local | from __future__ import annotations
from collections.abc import Generator
from unittest.mock import MagicMock, patch
import pytest
from aiohomematic.const import DataPointCategory, ScheduleProfile, ScheduleType
from aiohomematic.interfaces import ClimateWeekProfileDataPointProtocol, WeekProfileDataPointProtocol
from ... | 0 | assert | numeric_literal | tests/test_week_profile_sensor.py | test_native_value_zero | TestWeekProfileSensor | 283 | null |
SukramJ/homematicip_local | from __future__ import annotations
import pytest
from homeassistant.const import STATE_UNKNOWN
from tests import const, helper
from tests.helper import Factory
TEST_DEVICES: dict[str, str] = {
"VCU7837366": "HB-UNI-Sensor1.json",
}
class TestSensor:
@pytest.mark.asyncio
async def test_sensor_to_trans(... | STATE_UNKNOWN | assert | variable | tests/test_sensor.py | test_sensor_to_trans | TestSensor | 32 | null |
SukramJ/homematicip_local | from __future__ import annotations
from typing import Any
from unittest.mock import AsyncMock, patch
import pytest
from pytest_homeassistant_custom_component.common import MockConfigEntry
from aiohomematic.backend_detection import BackendDetectionResult
from aiohomematic.const import (
CONF_PASSWORD,
CONF_US... | 2010 | assert | numeric_literal | tests/test_config_flow.py | test_form | TestConfigFlowForm | 335 | null |
SukramJ/homematicip_local | from __future__ import annotations
from unittest.mock import AsyncMock, patch
import pytest
from custom_components.homematicip_local import repairs as hm_repairs
class TestRepairsFlow:
@pytest.mark.asyncio
async def test_async_create_fix_flow_and_confirm_with_callback(self, hass) -> None:
"""It sho... | "set_name" | assert | string_literal | tests/test_repairs.py | test_async_create_fix_flow_and_confirm_with_callback | TestRepairsFlow | 37 | null |
SukramJ/homematicip_local | from __future__ import annotations
import pytest
class TestClimateRawCCUData:
@pytest.mark.asyncio
async def test_climate_get_paramset_returns_13_slots(self) -> None:
"""
Test that get_paramset for climate returns 13-slot data.
When reading schedule from CCU, we get the raw 13-slot f... | 360 | assert | numeric_literal | tests/test_schedule_ccu_raw_data.py | test_climate_get_paramset_returns_13_slots | TestClimateRawCCUData | 131 | null |
SukramJ/homematicip_local | from __future__ import annotations
from types import SimpleNamespace
from unittest.mock import MagicMock
import pytest
from custom_components.homematicip_local.mqtt import MQTTConsumer
def _msg(topic: str, payload: str):
# The handlers only access .topic and .payload; keep it simple
return SimpleNamespace(t... | None | assert | none_literal | tests/test_mqtt.py | test_subscribe_and_unsubscribe_when_mqtt_available | TestMQTTConsumer | 109 | null |
SukramJ/homematicip_local | from __future__ import annotations
from pathlib import Path
from typing import Any
from unittest.mock import AsyncMock, Mock, patch
import pytest
from aiohomematic.const import ForcedDeviceAvailability, ParamsetKey
from aiohomematic.exceptions import BaseHomematicException
from custom_components.homematicip_local.co... | 14 | assert | numeric_literal | tests/test_services_handlers.py | test_create_ccu_backup_success | TestServiceCreateCcuBackup | 1,002 | null |
SukramJ/homematicip_local | from __future__ import annotations
from dataclasses import dataclass
from typing import Any
from unittest.mock import AsyncMock, Mock
import pytest
from pytest_homeassistant_custom_component.common import MockConfigEntry, mock_device_registry
from custom_components.homematicip_local import DOMAIN as HMIP_DOMAIN
from... | 1 | assert | numeric_literal | tests/test_device_trigger.py | test_async_get_triggers_all_paths | TestAsyncGetTriggers | 175 | null |
SukramJ/homematicip_local | from __future__ import annotations
from aiohomematic.const import DataPointCategory
from custom_components.homematicip_local.entity_helpers import REGISTRY
class TestEntityHelper:
def test_registry_find_binary_sensor(self) -> None:
"""Test finding a binary sensor description."""
description = REG... | "MOTION" | assert | string_literal | tests/test_entity_helper.py | test_registry_find_binary_sensor | TestEntityHelper | 32 | null |
SukramJ/homematicip_local | from __future__ import annotations
from unittest.mock import AsyncMock, patch
from pytest_homeassistant_custom_component.common import MockConfigEntry
from aiohomematic.exceptions import AuthFailure
import custom_components.homematicip_local
from custom_components.homematicip_local.config_flow import DomainConfigFlo... | "config_entry_reauth" | assert | string_literal | tests/test_init.py | test_setup_entry_auth_failure | TestSetupEntry | 89 | null |
SukramJ/homematicip_local | from __future__ import annotations
from collections.abc import Callable
from aiohomematic.const import DeviceTriggerEventType
from custom_components.homematicip_local.const import (
DOMAIN as HMIP_DOMAIN,
EVENT_ADDRESS,
EVENT_AGE_SECONDS,
EVENT_CHANNEL_NO,
EVENT_DEVICE_ID,
EVENT_ERROR,
EVE... | EVENT_TYPE_OPTIMISTIC_ROLLBACK | assert | variable | tests/test_logbook.py | test_registers_optimistic_rollback_describer | TestAsyncDescribeEvents | 77 | null |
SukramJ/homematicip_local | from __future__ import annotations
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from custom_components.homematicip_local.panel import (
_STATIC_PATH_REGISTERED_KEY,
PANEL_REGISTERED_KEY,
async_register_panel,
async_unregister_panel,
)
from homeassistant.core import HomeAssistan... | "homematic-config") | assert_* | string_literal | tests/test_panel.py | test_unregister_panel_success | TestAsyncUnregisterPanel | 136 | null |
SukramJ/homematicip_local | from __future__ import annotations
from pathlib import Path
from unittest.mock import AsyncMock, MagicMock, Mock, patch
import pytest
from aiohomematic.const import CCUType
from aiohomematic.exceptions import BaseHomematicException
from custom_components.homematicip_local.update import (
ATTR_FIRMWARE_UPDATE_STA... | None | assert | none_literal | tests/test_update.py | test_in_progress_none | TestAioHomematicUpdateProperties | 147 | null |
SukramJ/homematicip_local | from __future__ import annotations
from pathlib import Path
from typing import Any
from unittest.mock import AsyncMock, Mock, patch
import pytest
from aiohomematic.const import ForcedDeviceAvailability, ParamsetKey
from aiohomematic.exceptions import BaseHomematicException
from custom_components.homematicip_local.co... | mock_hm_device | assert | variable | tests/test_services_handlers.py | test_get_hm_device_by_service_data_by_channel_address | TestHelperFunctions | 1,048 | null |
SukramJ/homematicip_local | from __future__ import annotations
from dataclasses import dataclass
from unittest.mock import AsyncMock, MagicMock
import pytest
from custom_components.homematicip_local.diagnostics import async_get_config_entry_diagnostics
class TestAsyncGetConfigEntryDiagnostics:
@pytest.mark.asyncio
async def test_comp... | 1 | assert | numeric_literal | tests/test_diagnostics.py | test_compiles_payload_and_redacts | TestAsyncGetConfigEntryDiagnostics | 134 | null |
SukramJ/homematicip_local | from __future__ import annotations
import pytest
from pytest_homeassistant_custom_component.components.recorder.common import async_wait_recording_done
from aiohomematic.const import DeviceFirmwareState
from custom_components.homematicip_local.const import EVENT_ADDRESS, EVENT_INTERFACE_ID, EVENT_MODEL
from custom_co... | DeviceFirmwareState.UP_TO_DATE | assert | complex_expr | tests/test_recorder.py | no_test_update_entity_un_recorded | TestRecorder | 168 | null |
SukramJ/homematicip_local | from __future__ import annotations
import asyncio
from typing import cast
import pytest
from aiohomematic.model.hub import SysvarDpSwitch
from homeassistant.const import STATE_OFF, STATE_ON
from tests import const, helper
from tests.helper import Factory
TEST_DEVICES: dict[str, str] = {
"VCU2128127": "HmIP-BSM... | 2 | assert | numeric_literal | tests/test_switch.py | test_hmsysvarswitch | TestSysvarDpSwitch | 87 | null |
SukramJ/homematicip_local | from __future__ import annotations
from unittest.mock import AsyncMock, patch
import pytest
from custom_components.homematicip_local import repairs as hm_repairs
class TestRepairsFlow:
@pytest.mark.asyncio
async def test_async_create_fix_flow_and_confirm_with_callback(self, hass) -> None:
"""It sho... | "ABC0001" | assert | string_literal | tests/test_repairs.py | test_async_create_fix_flow_and_confirm_with_callback | TestRepairsFlow | 40 | null |
SukramJ/homematicip_local | from __future__ import annotations
from unittest.mock import AsyncMock, patch
import pytest
from custom_components.homematicip_local import repairs as hm_repairs
class TestRepairsFlow:
@pytest.mark.asyncio
async def test_async_create_fix_flow_and_confirm_with_callback(self, hass) -> None:
"""It sho... | "create_entry" | assert | string_literal | tests/test_repairs.py | test_async_create_fix_flow_and_confirm_with_callback | TestRepairsFlow | 48 | null |
SukramJ/homematicip_local | from __future__ import annotations
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from aiohomematic.interfaces import ClimateWeekProfileDataPointProtocol
from custom_components.homematicip_local.const import HmipLocalServices
from homeassistant.exceptions import HomeAssistantError
class TestGet... | result | assert | variable | tests/test_climate_schedule_services.py | test_get_schedule_weekday_calls_wp_dp | TestGetScheduleWeekdayHandler | 97 | null |
SukramJ/homematicip_local | from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from typing import Any
from unittest.mock import AsyncMock
import pytest
import custom_components.homematicip_local.services as hm_services
from homeassistant.core import HomeAssistant
class TestAsyncSetupServi... | 123 | assert | numeric_literal | tests/test_services.py | test_registers_and_dispatches_all | TestAsyncSetupServices | 168 | null |
SukramJ/homematicip_local | from __future__ import annotations
from pathlib import Path
from typing import Any
from unittest.mock import AsyncMock, Mock, patch
import pytest
from aiohomematic.const import ForcedDeviceAvailability, ParamsetKey
from aiohomematic.exceptions import BaseHomematicException
from custom_components.homematicip_local.co... | True | assert | bool_literal | tests/test_services_handlers.py | test_create_ccu_backup_success | TestServiceCreateCcuBackup | 1,000 | null |
SukramJ/homematicip_local | from __future__ import annotations
from types import SimpleNamespace
import voluptuous as vol
from aiohomematic.const import IDENTIFIER_SEPARATOR
from custom_components.homematicip_local.const import EVENT_CHANNEL_NO, EVENT_PARAMETER
from custom_components.homematicip_local.support import (
cleanup_click_event_d... | ("ABC123", "HmIP-RF") | assert | collection | tests/test_support.py | test_parses_regular_device | TestGetDeviceAddressAtInterfaceFromIdentifiers | 70 | null |
SukramJ/homematicip_local | from __future__ import annotations
from collections.abc import Generator
from unittest.mock import MagicMock, patch
import pytest
from aiohomematic.const import DataPointCategory, ScheduleProfile, ScheduleType
from aiohomematic.interfaces import ClimateWeekProfileDataPointProtocol, WeekProfileDataPointProtocol
from ... | ["P1", "P2", "P3"] | assert | collection | tests/test_week_profile_sensor.py | test_extra_state_attributes_climate | TestWeekProfileSensor | 164 | null |
SukramJ/homematicip_local | from __future__ import annotations
from aiohomematic.const import DataPointCategory
from custom_components.homematicip_local.entity_helpers import REGISTRY
class TestEntityHelper:
def test_registry_defaults(self) -> None:
"""Test that defaults are returned when no rule matches."""
# SWITCH should... | "switch_default" | assert | string_literal | tests/test_entity_helper.py | test_registry_defaults | TestEntityHelper | 22 | null |
SukramJ/homematicip_local | from __future__ import annotations
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from aiohomematic.interfaces import ClimateWeekProfileDataPointProtocol
from custom_components.homematicip_local.const import HmipLocalServices
from homeassistant.exceptions import HomeAssistantError
class TestGet... | HomeAssistantError, match="does not support climate schedules") | pytest.raises | complex_expr | tests/test_climate_schedule_services.py | test_get_schedule_profile_raises_if_not_climate | TestGetScheduleProfileHandler | 61 | null |
SukramJ/homematicip_local | from __future__ import annotations
import inspect
from pathlib import Path
import pytest
import yaml
from custom_components.homematicip_local.const import DOMAIN, HmipLocalServices
from homeassistant.core import HomeAssistant
SERVICES_YAML_PATH = Path(__file__).parent.parent.parent / "custom_components" / "homemati... | service_def | assert | variable | tests/contract/test_set_schedule_service_contract.py | test_copy_schedule_defined | TestScheduleServiceYamlContract | 152 | null |
SukramJ/homematicip_local | from __future__ import annotations
import inspect
from pathlib import Path
import pytest
import yaml
from custom_components.homematicip_local.const import DOMAIN, HmipLocalServices
from homeassistant.core import HomeAssistant
SERVICES_YAML_PATH = Path(__file__).parent.parent.parent / "custom_components" / "homemati... | content | assert | variable | tests/contract/test_set_schedule_service_contract.py | test_device_based_registration_used | TestScheduleServiceImplementationContract | 333 | null |
SukramJ/homematicip_local | from __future__ import annotations
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from custom_components.homematicip_local.panel import (
_STATIC_PATH_REGISTERED_KEY,
PANEL_REGISTERED_KEY,
async_register_panel,
async_unregister_panel,
)
from homeassistant.core import HomeAssistan... | None | assert | none_literal | tests/test_panel.py | test_register_panel_after_reload | TestAsyncRegisterPanel | 54 | null |
SukramJ/homematicip_local | from __future__ import annotations
import pytest
from homeassistant.const import STATE_OFF, STATE_ON
from tests import const, helper
from tests.helper import Factory
TEST_DEVICES: dict[str, str] = {
"VCU5864966": "HmIP-SWDO-I.json",
}
class TestHmBinarySensor:
@pytest.mark.asyncio
async def test_hmbin... | STATE_OFF | assert | variable | tests/test_binary_sensor.py | test_hmbinarysensor | TestHmBinarySensor | 37 | null |
SukramJ/homematicip_local | from __future__ import annotations
from aiohomematic.const import DataPointCategory
from custom_components.homematicip_local.entity_helpers import REGISTRY
class TestEntityHelper:
def test_registry_find_with_device_override(self) -> None:
"""Test that device-specific overrides work."""
# Generic ... | "mHz" | assert | string_literal | tests/test_entity_helper.py | test_registry_find_with_device_override | TestEntityHelper | 72 | null |
SukramJ/homematicip_local | from __future__ import annotations
import pytest
from pytest_homeassistant_custom_component.components.recorder.common import async_wait_recording_done
from aiohomematic.const import DeviceFirmwareState
from custom_components.homematicip_local.const import EVENT_ADDRESS, EVENT_INTERFACE_ID, EVENT_MODEL
from custom_co... | 12 | assert | numeric_literal | tests/test_recorder.py | no_test_event_entity_un_recorded | TestRecorder | 65 | null |
SukramJ/homematicip_local | from __future__ import annotations
from typing import Any
from unittest.mock import AsyncMock, patch
import pytest
from pytest_homeassistant_custom_component.common import MockConfigEntry
from aiohomematic.backend_detection import BackendDetectionResult
from aiohomematic.const import (
CONF_PASSWORD,
CONF_US... | None | assert | none_literal | tests/test_config_flow.py | async_check_form | 179 | null | |
SukramJ/homematicip_local | from __future__ import annotations
from types import SimpleNamespace
import voluptuous as vol
from aiohomematic.const import IDENTIFIER_SEPARATOR
from custom_components.homematicip_local.const import EVENT_CHANNEL_NO, EVENT_PARAMETER
from custom_components.homematicip_local.support import (
cleanup_click_event_d... | "ABC1234567" | assert | string_literal | tests/test_support.py | test_channel_address_extracts_device_part | TestValidateDeviceAddress | 100 | null |
SukramJ/homematicip_local | from __future__ import annotations
from collections.abc import Generator
from unittest.mock import MagicMock, patch
import pytest
from aiohomematic.const import DataPointCategory, ScheduleProfile, ScheduleType
from aiohomematic.interfaces import ClimateWeekProfileDataPointProtocol, WeekProfileDataPointProtocol
from ... | 4.5 | assert | numeric_literal | tests/test_week_profile_sensor.py | test_extra_state_attributes_climate | TestWeekProfileSensor | 162 | null |
SukramJ/homematicip_local | from __future__ import annotations
from pathlib import Path
from typing import Any
from unittest.mock import AsyncMock, Mock, patch
import pytest
from aiohomematic.const import ForcedDeviceAvailability, ParamsetKey
from aiohomematic.exceptions import BaseHomematicException
from custom_components.homematicip_local.co... | None | assert | none_literal | tests/test_services_handlers.py | test_get_device_value_none | TestServiceGetDeviceValue | 386 | null |
SukramJ/homematicip_local | from __future__ import annotations
from typing import Any
from unittest.mock import AsyncMock, patch
import pytest
from pytest_homeassistant_custom_component.common import MockConfigEntry
from aiohomematic.backend_detection import BackendDetectionResult
from aiohomematic.const import (
CONF_PASSWORD,
CONF_US... | "" | assert | string_literal | tests/test_config_flow.py | async_check_options_form | 323 | null | |
SukramJ/homematicip_local | from __future__ import annotations
from unittest.mock import AsyncMock, patch
from pytest_homeassistant_custom_component.common import MockConfigEntry
from aiohomematic.exceptions import AuthFailure
import custom_components.homematicip_local
from custom_components.homematicip_local.config_flow import DomainConfigFlo... | 1 | assert | numeric_literal | tests/test_init.py | test_setup_entry | TestSetupEntry | 49 | null |
SukramJ/homematicip_local | from __future__ import annotations
from aiohomematic.const import DataPointCategory
from custom_components.homematicip_local.entity_helpers import REGISTRY
class TestEntityHelper:
def test_registry_defaults(self) -> None:
"""Test that defaults are returned when no rule matches."""
# SWITCH should... | None | assert | none_literal | tests/test_entity_helper.py | test_registry_defaults | TestEntityHelper | 21 | null |
SukramJ/homematicip_local | from __future__ import annotations
from collections.abc import Generator
from unittest.mock import MagicMock, patch
import pytest
from aiohomematic.const import DataPointCategory, ScheduleProfile, ScheduleType
from aiohomematic.interfaces import ClimateWeekProfileDataPointProtocol, WeekProfileDataPointProtocol
from ... | 30.5 | assert | numeric_literal | tests/test_week_profile_sensor.py | test_extra_state_attributes_climate | TestWeekProfileSensor | 163 | null |
SukramJ/homematicip_local | from __future__ import annotations
from pathlib import Path
from typing import Any
from unittest.mock import AsyncMock, Mock, patch
import pytest
from aiohomematic.const import ForcedDeviceAvailability, ParamsetKey
from aiohomematic.exceptions import BaseHomematicException
from custom_components.homematicip_local.co... | {"PARAM1": 1} | assert | collection | tests/test_services_handlers.py | test_get_link_paramset_success | TestServiceGetLinkParamset | 505 | null |
SukramJ/homematicip_local | from __future__ import annotations
import pytest
class TestNonClimateRawCCUData:
@pytest.mark.asyncio
async def test_switch_weekly_schedule_put_paramset_call(self) -> None:
"""
Test what put_paramset is called with for a switch schedule.
Shows the actual XML-RPC call that would be ma... | "06:00" | assert | string_literal | tests/test_schedule_ccu_raw_data.py | test_switch_weekly_schedule_put_paramset_call | TestNonClimateRawCCUData | 87 | null |
SukramJ/homematicip_local | from __future__ import annotations
from typing import Any
from unittest.mock import AsyncMock, patch
import pytest
from pytest_homeassistant_custom_component.common import MockConfigEntry
from aiohomematic.backend_detection import BackendDetectionResult
from aiohomematic.const import (
CONF_PASSWORD,
CONF_US... | 30 | assert | numeric_literal | tests/test_config_flow.py | test_update_advanced_input_with_un_ignores | TestConfigFlowHelpers | 1,211 | null |
SukramJ/homematicip_local | from __future__ import annotations
from types import SimpleNamespace
import voluptuous as vol
from aiohomematic.const import IDENTIFIER_SEPARATOR
from custom_components.homematicip_local.const import EVENT_CHANNEL_NO, EVENT_PARAMETER
from custom_components.homematicip_local.support import (
cleanup_click_event_d... | "short_press" | assert | string_literal | tests/test_support.py | test_transforms_and_removes | TestCleanupClickEventData | 42 | null |
SukramJ/homematicip_local | from __future__ import annotations
import datetime
from typing import Any
from unittest.mock import Mock, patch
import pytest
from pytest_homeassistant_custom_component.common import MockConfigEntry
from pytest_homeassistant_custom_component.plugins import enable_custom_integrations # noqa: F401
import pytest_socket... | ConfigEntryState.LOADED | assert | complex_expr | tests/conftest.py | mock_loaded_config_entry | 224 | null | |
SukramJ/homematicip_local | from __future__ import annotations
from typing import Any
from unittest.mock import AsyncMock, patch
import pytest
from pytest_homeassistant_custom_component.common import MockConfigEntry
from aiohomematic.backend_detection import BackendDetectionResult
from aiohomematic.const import (
CONF_PASSWORD,
CONF_US... | 2000 | assert | numeric_literal | tests/test_config_flow.py | test_form_only_hs485 | TestConfigFlowForm | 398 | null |
SukramJ/homematicip_local | from __future__ import annotations
from types import SimpleNamespace
import voluptuous as vol
from aiohomematic.const import IDENTIFIER_SEPARATOR
from custom_components.homematicip_local.const import EVENT_CHANNEL_NO, EVENT_PARAMETER
from custom_components.homematicip_local.support import (
cleanup_click_event_d... | vol.Invalid, match="must be a string") | pytest.raises | complex_expr | tests/test_support.py | test_invalid_format_raises | TestValidateDeviceAddress | 109 | null |
SukramJ/homematicip_local | from __future__ import annotations
import pytest
from homeassistant.const import STATE_UNKNOWN
from tests import const, helper
from tests.helper import Factory
TEST_DEVICES: dict[str, str] = {
"VCU7837366": "HB-UNI-Sensor1.json",
}
class TestSensor:
@pytest.mark.asyncio
async def test_sensor_to_trans(... | "1.0" | assert | string_literal | tests/test_sensor.py | test_sensor_to_trans | TestSensor | 39 | null |
SukramJ/homematicip_local | from __future__ import annotations
from typing import Any
from unittest.mock import AsyncMock, MagicMock, Mock, patch
import pytest
from custom_components.homematicip_local.light import (
ATTR_CHANNEL_BRIGHTNESS,
ATTR_CHANNEL_COLOR,
ATTR_COLOR,
ATTR_LAST_BRIGHTNESS,
AioHomematicLight,
async_s... | 200 | assert | numeric_literal | tests/test_light.py | test_brightness_invalid_with_restored_state | TestAioHomematicLightBrightness | 121 | null |
SukramJ/homematicip_local | from __future__ import annotations
from types import SimpleNamespace
import voluptuous as vol
from aiohomematic.const import IDENTIFIER_SEPARATOR
from custom_components.homematicip_local.const import EVENT_CHANNEL_NO, EVENT_PARAMETER
from custom_components.homematicip_local.support import (
cleanup_click_event_d... | "HmIP-RF-12345" | assert | string_literal | tests/test_support.py | test_channel_address_extracts_device_part | TestValidateDeviceAddress | 101 | null |
SukramJ/homematicip_local | from __future__ import annotations
from aiohomematic.const import DataPointCategory
from custom_components.homematicip_local.entity_helpers import REGISTRY
class TestEntityHelper:
def test_registry_find_with_device_override(self) -> None:
"""Test that device-specific overrides work."""
# Generic ... | "Hz" | assert | string_literal | tests/test_entity_helper.py | test_registry_find_with_device_override | TestEntityHelper | 63 | null |
SukramJ/homematicip_local | from __future__ import annotations
from aiohomematic.const import DataPointCategory
from custom_components.homematicip_local.entity_helpers import REGISTRY
class TestEntityHelper:
def test_registry_has_rules(self) -> None:
"""Test that the registry has rules registered."""
stats = REGISTRY.get_st... | 0 | assert | numeric_literal | tests/test_entity_helper.py | test_registry_has_rules | TestEntityHelper | 89 | null |
SukramJ/homematicip_local | from __future__ import annotations
from collections.abc import Callable
from aiohomematic.const import DeviceTriggerEventType
from custom_components.homematicip_local.const import (
DOMAIN as HMIP_DOMAIN,
EVENT_ADDRESS,
EVENT_AGE_SECONDS,
EVENT_CHANNEL_NO,
EVENT_DEVICE_ID,
EVENT_ERROR,
EVE... | "unknown" | assert | string_literal | tests/test_logbook.py | test_handles_missing_fields_gracefully | TestOptimisticRollbackDescriber | 181 | null |
SukramJ/homematicip_local | from __future__ import annotations
import pytest
from homeassistant.const import STATE_OFF, STATE_ON
from tests import const, helper
from tests.helper import Factory
TEST_DEVICES: dict[str, str] = {
"VCU5864966": "HmIP-SWDO-I.json",
}
class TestHmBinarySensor:
@pytest.mark.asyncio
async def test_hmbin... | STATE_ON | assert | variable | tests/test_binary_sensor.py | test_hmbinarysensor | TestHmBinarySensor | 44 | null |
SukramJ/homematicip_local | from __future__ import annotations
from types import SimpleNamespace
import voluptuous as vol
from aiohomematic.const import IDENTIFIER_SEPARATOR
from custom_components.homematicip_local.const import EVENT_CHANNEL_NO, EVENT_PARAMETER
from custom_components.homematicip_local.support import (
cleanup_click_event_d... | 1 | assert | numeric_literal | tests/test_support.py | test_transforms_and_removes | TestCleanupClickEventData | 48 | null |
SukramJ/homematicip_local | from __future__ import annotations
import contextlib
from datetime import datetime
import inspect
import logging
from types import FunctionType, MethodType
from typing import Any, Final, TypeVar
from unittest.mock import MagicMock, Mock, patch
from pytest_homeassistant_custom_component.common import MockConfigEntry
... | None | assert | none_literal | tests/helper.py | get_and_check_state | 121 | null | |
SukramJ/homematicip_local | from __future__ import annotations
from pathlib import Path
from unittest.mock import AsyncMock, MagicMock, Mock, patch
import pytest
from aiohomematic.const import CCUType
from aiohomematic.exceptions import BaseHomematicException
from custom_components.homematicip_local.update import (
ATTR_FIRMWARE_UPDATE_STA... | [] | assert | collection | tests/test_update.py | test_init | TestAioHomematicUpdateInit | 357 | null |
SukramJ/homematicip_local | from __future__ import annotations
from unittest.mock import AsyncMock, patch
import pytest
from custom_components.homematicip_local import repairs as hm_repairs
class TestRepairsFlow:
@pytest.mark.asyncio
async def test_async_create_fix_flow_and_confirm_with_callback(self, hass) -> None:
"""It sho... | "form" | assert | string_literal | tests/test_repairs.py | test_async_create_fix_flow_and_confirm_with_callback | TestRepairsFlow | 36 | null |
SukramJ/homematicip_local | from __future__ import annotations
from collections.abc import Generator
from unittest.mock import MagicMock, patch
import pytest
from aiohomematic.const import DataPointCategory, ScheduleProfile, ScheduleType
from aiohomematic.interfaces import ClimateWeekProfileDataPointProtocol, WeekProfileDataPointProtocol
from ... | "climate" | assert | string_literal | tests/test_week_profile_sensor.py | test_extra_state_attributes_climate | TestWeekProfileSensor | 160 | null |
SukramJ/homematicip_local | from __future__ import annotations
from typing import Any
from unittest.mock import AsyncMock, patch
import pytest
from pytest_homeassistant_custom_component.common import MockConfigEntry
from aiohomematic.backend_detection import BackendDetectionResult
from aiohomematic.const import (
CONF_PASSWORD,
CONF_US... | "2" | assert | string_literal | tests/test_config_flow.py | test_flow_hassio_discovery | TestDiscoveryFlow | 986 | null |
SukramJ/homematicip_local | from __future__ import annotations
from collections.abc import Callable
from aiohomematic.const import DeviceTriggerEventType
from custom_components.homematicip_local.const import (
DOMAIN as HMIP_DOMAIN,
EVENT_ADDRESS,
EVENT_AGE_SECONDS,
EVENT_CHANNEL_NO,
EVENT_DEVICE_ID,
EVENT_ERROR,
EVE... | "Optimistic update rolled back for unknown (reason: unknown)" | assert | string_literal | tests/test_logbook.py | test_handles_missing_fields_gracefully | TestOptimisticRollbackDescriber | 182 | null |
SukramJ/homematicip_local | from __future__ import annotations
from typing import Any
from unittest.mock import AsyncMock, MagicMock, Mock, patch
import pytest
from custom_components.homematicip_local.light import (
ATTR_CHANNEL_BRIGHTNESS,
ATTR_CHANNEL_COLOR,
ATTR_COLOR,
ATTR_LAST_BRIGHTNESS,
AioHomematicLight,
async_s... | 3 | assert | numeric_literal | tests/test_light.py | test_turn_on_with_transition | TestAioHomematicLightTurnOn | 566 | null |
SukramJ/homematicip_local | from __future__ import annotations
from collections.abc import Generator
from unittest.mock import MagicMock, patch
import pytest
from aiohomematic.const import DataPointCategory, ScheduleProfile, ScheduleType
from aiohomematic.interfaces import ClimateWeekProfileDataPointProtocol, WeekProfileDataPointProtocol
from ... | ["P1"] | assert | collection | tests/test_week_profile_sensor.py | test_extra_state_attributes_climate_no_temp | TestWeekProfileSensor | 189 | null |
SukramJ/homematicip_local | from __future__ import annotations
import pytest
from pytest_homeassistant_custom_component.components.recorder.common import async_wait_recording_done
from aiohomematic.const import DeviceFirmwareState
from custom_components.homematicip_local.const import EVENT_ADDRESS, EVENT_INTERFACE_ID, EVENT_MODEL
from custom_co... | STATE_OFF | assert | variable | tests/test_recorder.py | no_test_generic_entity_un_recorded | TestRecorder | 90 | null |
SukramJ/homematicip_local | from __future__ import annotations
import contextlib
from datetime import datetime
import inspect
import logging
from types import FunctionType, MethodType
from typing import Any, Final, TypeVar
from unittest.mock import MagicMock, Mock, patch
from pytest_homeassistant_custom_component.common import MockConfigEntry
... | ConfigEntryState.LOADED | assert | complex_expr | tests/helper.py | setup_environment | Factory | 110 | null |
SukramJ/homematicip_local | from __future__ import annotations
import pytest
class TestDocumentationExamplesWithCCUData:
def test_weekend_schedule_ccu_transformation(self) -> None:
"""
Test Weekend Schedule from docs with CCU transformation.
Documentation example:
```yaml
base_temperature: 17.0
... | 8 * 60 | assert | complex_expr | tests/test_schedule_ccu_raw_data.py | test_weekend_schedule_ccu_transformation | TestDocumentationExamplesWithCCUData | 419 | null |
SukramJ/homematicip_local | from __future__ import annotations
from pathlib import Path
from typing import Any
from unittest.mock import AsyncMock, Mock, patch
import pytest
from aiohomematic.const import ForcedDeviceAvailability, ParamsetKey
from aiohomematic.exceptions import BaseHomematicException
from custom_components.homematicip_local.co... | HomeAssistantError) | pytest.raises | variable | tests/test_services_handlers.py | test_add_link_exception | TestServiceAddLink | 122 | null |
SukramJ/homematicip_local | from __future__ import annotations
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from aiohomematic.interfaces import ClimateWeekProfileDataPointProtocol, WeekProfileDataPointProtocol
from custom_components.homematicip_local.const import DOMAIN, HmipLocalServices
from homeassistant.core import H... | HomeAssistantError, match="Invalid schedule data") | pytest.raises | complex_expr | tests/test_set_schedule_service.py | test_set_schedule_wraps_validation_error | TestSetScheduleHandler | 206 | null |
SukramJ/homematicip_local | from __future__ import annotations
from pathlib import Path
from unittest.mock import AsyncMock, MagicMock, Mock, patch
import pytest
from aiohomematic.const import CCUType
from aiohomematic.exceptions import BaseHomematicException
from custom_components.homematicip_local.update import (
ATTR_FIRMWARE_UPDATE_STA... | 0 | assert | numeric_literal | tests/test_update.py | test_async_setup_entry_hub_update_callback_empty | TestAsyncSetupEntry | 728 | null |
SukramJ/homematicip_local | from __future__ import annotations
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from aiohomematic.interfaces import ClimateWeekProfileDataPointProtocol, WeekProfileDataPointProtocol
from homeassistant.exceptions import HomeAssistantError
def mock_wp_data_point() -> MagicMock:
"""Create a ... | ccu_weekday_data | assert | variable | tests/test_schedule_end_to_end.py | test_get_schedule_weekday_returns_ccu_data | TestClimateScheduleWeekdayEndToEnd | 269 | null |
SukramJ/homematicip_local | from __future__ import annotations
from unittest.mock import AsyncMock, patch
from pytest_homeassistant_custom_component.common import MockConfigEntry
from aiohomematic.exceptions import AuthFailure
import custom_components.homematicip_local
from custom_components.homematicip_local.config_flow import DomainConfigFlo... | None | assert | none_literal | tests/test_init.py | test_setup_entry_auth_failure | TestSetupEntry | 88 | null |
SukramJ/homematicip_local | from __future__ import annotations
from dataclasses import dataclass
from typing import Any
from unittest.mock import AsyncMock, Mock
import pytest
from pytest_homeassistant_custom_component.common import MockConfigEntry, mock_device_registry
from custom_components.homematicip_local import DOMAIN as HMIP_DOMAIN
from... | "press_short" | assert | string_literal | tests/test_device_trigger.py | test_trigger_schema_validation | TestTriggerSchema | 98 | null |
SukramJ/homematicip_local | from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from typing import Any
from unittest.mock import AsyncMock
import pytest
import custom_components.homematicip_local.services as hm_services
from homeassistant.core import HomeAssistant
class TestAsyncUnloadServ... | len(list(hm_services.HmipLocalServices)) | assert | func_call | tests/test_services.py | test_removes_all_when_no_entries | TestAsyncUnloadServices | 289 | null |
SukramJ/homematicip_local | from __future__ import annotations
from collections.abc import Callable
from aiohomematic.const import DeviceTriggerEventType
from custom_components.homematicip_local.const import (
DOMAIN as HMIP_DOMAIN,
EVENT_ADDRESS,
EVENT_AGE_SECONDS,
EVENT_CHANNEL_NO,
EVENT_DEVICE_ID,
EVENT_ERROR,
EVE... | {} | assert | collection | tests/test_logbook.py | test_returns_empty_dict_for_invalid_payload | TestDeviceErrorDescriber | 95 | null |
pre-commit/pre-commit | from __future__ import annotations
import pytest
from pre_commit.languages import pygrep
from testing.language_helpers import run_language
def some_files(tmpdir):
tmpdir.join('f1').write_binary(b'foo\nbar\n')
tmpdir.join('f2').write_binary(b'[INFO] hi\n')
tmpdir.join('f3').write_binary(b"with'quotes\n")
... | 'f4\nf5\nf6\n' | assert | string_literal | tests/languages/pygrep_test.py | test_negate_by_line_no_match | 47 | null | |
pre-commit/pre-commit | from __future__ import annotations
import logging
import re
import cfgv
import pytest
import pre_commit.constants as C
from pre_commit.clientlib import check_type_tag
from pre_commit.clientlib import CONFIG_HOOK_DICT
from pre_commit.clientlib import CONFIG_REPO_DICT
from pre_commit.clientlib import CONFIG_SCHEMA
fro... | 'unsupported' | assert | string_literal | tests/clientlib_test.py | test_unsupported_language_migration | 393 | null | |
pre-commit/pre-commit | from __future__ import annotations
import json
import os
import shutil
import sys
from unittest import mock
import pytest
import pre_commit.constants as C
from pre_commit import envcontext
from pre_commit import parse_shebang
from pre_commit.languages import node
from pre_commit.prefix import Prefix
from pre_commit.... | 'success!\n' | assert | string_literal | tests/languages/node_test.py | test_installs_without_links_outside_env | 113 | null | |
pre-commit/pre-commit | from __future__ import annotations
from pre_commit.meta_hooks import check_hooks_apply
from testing.fixtures import add_config_to_repo
def test_hook_excludes_everything(capsys, in_git_dir, mock_store_dir):
config = {
'repos': [
{
'repo': 'meta',
'hooks': [
... | out | assert | variable | tests/meta_hooks/check_hooks_apply_test.py | test_hook_excludes_everything | 27 | null | |
pre-commit/pre-commit | from __future__ import annotations
import logging
import os.path
import shlex
import sqlite3
import stat
from unittest import mock
import pytest
import pre_commit.constants as C
from pre_commit import git
from pre_commit.store import _get_default_directory
from pre_commit.store import _LOCAL_RESOURCES
from pre_commi... | rev | assert | variable | tests/store_test.py | test_clone | 102 | null | |
pre-commit/pre-commit | from __future__ import annotations
import pytest
from pre_commit.languages import pygrep
from testing.language_helpers import run_language
def some_files(tmpdir):
tmpdir.join('f1').write_binary(b'foo\nbar\n')
tmpdir.join('f2').write_binary(b'[INFO] hi\n')
tmpdir.join('f3').write_binary(b"with'quotes\n")
... | (0, b'') | assert | collection | tests/languages/pygrep_test.py | test_grep_hook_not_matching | 144 | null | |
pre-commit/pre-commit | from __future__ import annotations
import os.path
import sys
from unittest import mock
import pytest
import pre_commit.constants as C
from pre_commit import lang_base
from pre_commit import parse_shebang
from pre_commit import xargs
from pre_commit.prefix import Prefix
from pre_commit.util import CalledProcessError
... | '1.2.3') | assert_* | string_literal | tests/lang_base_test.py | test_assert_version_default | 92 | null | |
pre-commit/pre-commit | from __future__ import annotations
from pre_commit.meta_hooks import identity
def test_identity(cap_out):
assert not identity.main(('a', 'b', 'c'))
assert cap_out.get() == | 'a\nb\nc\n' | assert | string_literal | tests/meta_hooks/identity_test.py | test_identity | 8 | null | |
pre-commit/pre-commit | from __future__ import annotations
import contextlib
import itertools
import os.path
import shutil
import pytest
import re_assert
from pre_commit import git
from pre_commit.errors import FatalError
from pre_commit.staged_files_only import staged_files_only
from pre_commit.util import cmd_output
from testing.auto_nam... | 'unstaged changes' | assert | string_literal | tests/staged_files_only_test.py | test_submodule_does_not_discard_changes | 272 | null | |
pre-commit/pre-commit | from __future__ import annotations
import concurrent.futures
import multiprocessing
import os
import sys
import time
from unittest import mock
import pytest
from pre_commit import parse_shebang
from pre_commit import xargs
def no_sched_getaffinity():
# Simulates an OS without os.sched_getaffinity available (mac... | 5 | assert | numeric_literal | tests/xargs_test.py | test_xargs_retcode_normal | 182 | null | |
pre-commit/pre-commit | from __future__ import annotations
import os.path
import re
import time
from unittest import mock
import re_assert
from pre_commit import git
from pre_commit.commands.try_repo import try_repo
from pre_commit.util import cmd_output
from testing.auto_namedtuple import auto_namedtuple
from testing.fixtures import git_d... | 'Using config:\n' | assert | string_literal | tests/commands/try_repo_test.py | _get_out | 29 | null | |
pre-commit/pre-commit | from __future__ import annotations
import os
from unittest import mock
from pre_commit.languages import julia
from testing.language_helpers import run_language
from testing.util import cwd
def _make_hook(tmp_path, julia_code):
src_dir = tmp_path.joinpath('src')
src_dir.mkdir()
src_dir.joinpath('main.jl')... | expected | assert | variable | tests/languages/julia_test.py | test_julia_hook | 31 | null | |
pre-commit/pre-commit | from __future__ import annotations
import subprocess
import sys
from unittest import mock
import pytest
import pre_commit.constants as C
from pre_commit import git
from pre_commit.commands import hook_impl
from pre_commit.envcontext import envcontext
from pre_commit.util import cmd_output
from pre_commit.util import... | True | assert | bool_literal | tests/commands/hook_impl_test.py | test_run_ns_pre_commit | 155 | null | |
pre-commit/pre-commit | from __future__ import annotations
import os.path
import re
import time
from unittest import mock
import re_assert
from pre_commit import git
from pre_commit.commands.try_repo import try_repo
from pre_commit.util import cmd_output
from testing.auto_namedtuple import auto_namedtuple
from testing.fixtures import git_d... | '' | assert | string_literal | tests/commands/try_repo_test.py | test_try_repo_repo_only | 49 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.