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 |
|---|---|---|---|---|---|---|---|---|---|
graphql-python/graphene | from graphql_relay import to_global_id
from ...types import ID, NonNull, ObjectType, String
from ...types.definitions import GrapheneObjectType
from ..node import GlobalID, Node
def test_global_id_defaults_to_required_and_node():
gid = GlobalID()
assert isinstance(gid.type, NonNull)
assert gid.type.of_typ... | Node | assert | variable | graphene/relay/tests/test_global_id.py | test_global_id_defaults_to_required_and_node | 36 | null | |
graphql-python/graphene | from pytest import raises
from graphene import ObjectType, String
from ..module_loading import import_string, lazy_import
def test_import_string():
MyString = import_string("graphene.String")
assert MyString == String
MyObjectTypeMeta = import_string("graphene.ObjectType", "__doc__")
assert MyObjec... | ObjectType.__doc__ | assert | complex_expr | graphene/utils/tests/test_module_loading.py | test_import_string | 13 | null | |
graphql-python/graphene | import re
from pytest import raises
from graphql import parse, get_introspection_query, validate
from ...types import Schema, ObjectType, Interface
from ...types import String, Int, List, Field
from ..depth_limit import depth_limit_validator
def run_query(query: str, max_depth: int, ignore=None):
document = pars... | {"IntrospectionQuery": 0} | assert | collection | graphene/validation/tests/test_depth_limit_validator.py | test_should_ignore_the_introspection_query | 198 | null | |
graphql-python/graphene | import datetime
from graphql import GraphQLError
from pytest import fixture
from ..datetime import Date, DateTime, Time
from ..objecttype import ObjectType
from ..schema import Schema
def sample_datetime():
utc_datetime = datetime.datetime(2019, 5, 25, 5, 30, 15, 10, datetime.timezone.utc)
return utc_dateti... | {"datetime": isoformat} | assert | collection | graphene/types/tests/test_datetime.py | test_datetime_query | 59 | null | |
graphql-python/graphene | from textwrap import dedent
from ..argument import Argument
from ..enum import Enum, PyEnum
from ..field import Field
from ..inputfield import InputField
from ..inputobjecttype import InputObjectType
from ..mutation import Mutation
from ..scalars import String
from ..schema import ObjectType, Schema
def test_enum_fro... | PyRGB | assert | variable | graphene/types/tests/test_enum.py | test_enum_from_builtin_enum | 62 | null | |
graphql-python/graphene | from pytest import mark, raises
from ...types import (
ID,
Argument,
Field,
InputField,
InputObjectType,
NonNull,
ObjectType,
Schema,
)
from ...types.scalars import String
from ..mutation import ClientIDMutation
def test_mutation():
fields = SaySomething._meta.fields
assert lis... | ["input"] | assert | collection | graphene/relay/tests/test_mutation.py | test_mutation | 125 | null | |
graphql-python/graphene | from functools import partial
from pytest import raises
from ..scalars import String
from ..structures import List, NonNull
from .utils import MyLazyType
def test_list():
_list = List(String)
assert _list.of_type == String
assert str(_list) == | "[String]" | assert | string_literal | graphene/types/tests/test_structures.py | test_list | 13 | null | |
graphql-python/graphene | from graphql import Undefined
from ..argument import Argument
from ..field import Field
from ..inputfield import InputField
from ..inputobjecttype import InputObjectType
from ..objecttype import ObjectType
from ..scalars import Boolean, String
from ..schema import Schema
from ..unmountedtype import UnmountedType
from ... | {} | assert | collection | graphene/types/tests/test_inputobjecttype.py | test_generate_inputobjecttype | 29 | null | |
graphql-python/graphene | from ..json import JSONString
from ..objecttype import ObjectType
from ..schema import Schema
def test_jsonstring_invalid_query():
"""
Test that if an invalid type is provided we get an error
"""
result = schema.execute("{ json(input: 1) }")
assert result.errors == [
{"message": "Expected v... | 1 | assert | numeric_literal | graphene/types/tests/test_json.py | test_jsonstring_invalid_query | 77 | null | |
graphql-python/graphene | from textwrap import dedent
from ..argument import Argument
from ..enum import Enum, PyEnum
from ..field import Field
from ..inputfield import InputField
from ..inputobjecttype import InputObjectType
from ..mutation import Mutation
from ..scalars import String
from ..schema import ObjectType, Schema
def test_hashable... | "c" | assert | string_literal | graphene/types/tests/test_enum.py | test_hashable_enum | 550 | null | |
graphql-python/graphene | from functools import partial
from pytest import raises
from ..argument import Argument, to_arguments
from ..field import Field
from ..inputfield import InputField
from ..scalars import String
from ..structures import NonNull
def test_argument_comparasion():
arg1 = Argument(
String,
name="Hey",
... | String() | assert | func_call | graphene/types/tests/test_argument.py | test_argument_comparasion | 37 | null | |
graphql-python/graphene | from functools import partial
from pytest import raises
from ..argument import Argument
from ..field import Field
from ..scalars import String
from ..structures import NonNull
from .utils import MyLazyType
def test_field_source_argument_as_kw():
MyType = object()
deprecation_reason = "deprecated"
field =... | ["b", "c", "a"] | assert | collection | graphene/types/tests/test_field.py | test_field_source_argument_as_kw | 138 | null | |
graphql-python/graphene | import base64
from graphql import GraphQLError
from ..objecttype import ObjectType
from ..scalars import String
from ..schema import Schema
from ..base64 import Base64
class Query(ObjectType):
base64 = Base64(_in=Base64(name="input"), _match=String(name="match"))
bytes_as_base64 = Base64()
string_as_base... | _match | assert | variable | graphene/types/tests/test_base64.py | resolve_base64 | Query | 19 | null |
graphql-python/graphene | from graphql_relay import to_global_id
from ...types import ID, NonNull, ObjectType, String
from ...types.definitions import GrapheneObjectType
from ..node import GlobalID, Node
def test_global_id_defaults_to_required_and_node():
gid = GlobalID()
assert isinstance(gid.type, NonNull)
assert gid.type.of_ty... | ID | assert | variable | graphene/relay/tests/test_global_id.py | test_global_id_defaults_to_required_and_node | 35 | null | |
graphql-python/graphene | from pytest import raises
from ..field import Field
from ..interface import Interface
from ..objecttype import ObjectType
from ..scalars import String
from ..schema import Schema
from ..structures import NonNull
from ..unmountedtype import UnmountedType
def test_generate_objecttype():
class MyObjectType(ObjectTyp... | tuple() | assert | func_call | graphene/types/tests/test_objecttype.py | test_generate_objecttype | 44 | null | |
graphql-python/graphene | from pytest import raises
from ..field import Field
from ..objecttype import ObjectType
from ..union import Union
from ..unmountedtype import UnmountedType
def test_union_can_be_mounted():
class MyUnion(Union):
class Meta:
types = (MyObjectType1, MyObjectType2)
my_union_instance = MyUnion... | MyUnion | assert | variable | graphene/types/tests/test_union.py | test_union_can_be_mounted | 58 | null | |
graphql-python/graphene | from pytest import raises
from ..field import Field
from ..interface import Interface
from ..objecttype import ObjectType
from ..scalars import String
from ..schema import Schema
from ..structures import NonNull
from ..unmountedtype import UnmountedType
def test_generate_objecttype():
class MyObjectType(ObjectTyp... | {} | assert | collection | graphene/types/tests/test_objecttype.py | test_generate_objecttype | 45 | null | |
graphql-python/graphene | from functools import partial
from pytest import raises
from ..argument import Argument, to_arguments
from ..field import Field
from ..inputfield import InputField
from ..scalars import String
from ..structures import NonNull
def test_argument():
arg = Argument(String, default_value="a", description="desc", name... | "desc" | assert | string_literal | graphene/types/tests/test_argument.py | test_argument | 16 | null | |
graphql-python/graphene | from functools import partial
from ..dynamic import Dynamic
from ..scalars import String
from ..structures import List, NonNull
def test_nonnull():
dynamic = Dynamic(lambda: NonNull(String))
assert dynamic.get_type().of_type == String
assert str(dynamic.get_type()) == | "String!" | assert | string_literal | graphene/types/tests/test_dynamic.py | test_nonnull | 17 | null | |
graphql-python/graphene | from functools import partial
from pytest import raises
from ..scalars import String
from ..structures import List, NonNull
from .utils import MyLazyType
def test_nonnull():
nonnull = NonNull(String)
assert nonnull.of_type == String
assert str(nonnull) == | "String!" | assert | string_literal | graphene/types/tests/test_structures.py | test_nonnull | 58 | null | |
graphql-python/graphene | from textwrap import dedent
from ..argument import Argument
from ..enum import Enum, PyEnum
from ..field import Field
from ..inputfield import InputField
from ..inputobjecttype import InputObjectType
from ..mutation import Mutation
from ..scalars import String
from ..schema import ObjectType, Schema
def test_enum_val... | 3 | assert | numeric_literal | graphene/types/tests/test_enum.py | test_enum_value_from_class | 145 | null | |
graphql-python/graphene | from .. import deprecated
from ..deprecated import warn_deprecation
def test_warn_deprecation(mocker):
mocker.patch.object(deprecated, "warn")
warn_deprecation("OH!")
deprecated.warn.assert_called_with( | "OH!") | assert_* | string_literal | graphene/utils/tests/test_deprecated.py | test_warn_deprecation | 9 | null | |
graphql-python/graphene | from ..objecttype import ObjectType, Field
from ..scalars import Scalar, Int, BigInt, Float, String, Boolean
from ..schema import Schema
from graphql import Undefined
from graphql.language.ast import IntValueNode
def return_input(_parent, _info, input):
return input
class TestInt:
def test_optional_input(sel... | {"optional": {"int": None}} | assert | collection | graphene/types/tests/test_scalar.py | test_optional_input | TestInt | 75 | null |
graphql-python/graphene | from ..objecttype import ObjectType
from ..schema import Schema
from ..uuid import UUID
from ..structures import NonNull
def test_uuidstring_query():
uuid_value = "dfeb3bcf-70fd-11e7-a61a-6003088f8204"
result = schema.execute("""{ uuid(input: "%s") }""" % uuid_value)
assert not result.errors
assert re... | {"uuid": uuid_value} | assert | collection | graphene/types/tests/test_uuid.py | test_uuidstring_query | 25 | null | |
graphql-python/graphene | import copy
from ..argument import Argument
from ..definitions import GrapheneGraphQLType
from ..enum import Enum
from ..field import Field
from ..inputfield import InputField
from ..inputobjecttype import InputObjectType
from ..interface import Interface
from ..objecttype import ObjectType
from ..scalars import Boole... | "MyEnum" | assert | string_literal | graphene/types/tests/test_definition.py | test_stringifies_simple_types | 221 | null | |
graphql-python/graphene | import copy
from ..argument import Argument
from ..definitions import GrapheneGraphQLType
from ..enum import Enum
from ..field import Field
from ..inputfield import InputField
from ..inputobjecttype import InputObjectType
from ..interface import Interface
from ..objecttype import ObjectType
from ..scalars import Boole... | Query | assert | variable | graphene/types/tests/test_definition.py | test_defines_a_query_only_schema | 75 | 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" | assert | string_literal | tests/test_recorder.py | no_test_generic_entity_un_recorded | TestRecorder | 95 | 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... | True | assert | bool_literal | tests/test_panel.py | test_register_panel_after_reload | TestAsyncRegisterPanel | 46 | 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... | True | assert | bool_literal | tests/test_mqtt.py | test_device_message_handler_calls_central | TestMQTTConsumer | 79 | null |
SukramJ/homematicip_local | from __future__ import annotations
import pytest
class TestDocumentationExamplesWithCCUData:
def test_workday_schedule_ccu_transformation(self) -> None:
"""
Test Workday Schedule from docs with CCU transformation.
Documentation example:
```yaml
base_temperature: 17.0
... | 17 * 60 | assert | complex_expr | tests/test_schedule_ccu_raw_data.py | test_workday_schedule_ccu_transformation | TestDocumentationExamplesWithCCUData | 466 | null |
SukramJ/homematicip_local | from __future__ import annotations
import pytest
class TestClimateRawCCUData:
def test_simple_format_to_13_slot_transformation(self) -> None:
"""
Test how simple format is transformed to 13-slot format.
Simple format (from documentation):
```yaml
base_temperature: 17.0
... | 6 * 60 | assert | complex_expr | tests/test_schedule_ccu_raw_data.py | test_simple_format_to_13_slot_transformation | TestClimateRawCCUData | 210 | 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... | "1" | assert | string_literal | tests/test_config_flow.py | test_flow_hassio_discovery | TestDiscoveryFlow | 985 | 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... | 100 | assert | numeric_literal | tests/test_light.py | test_turn_on_uses_current_brightness | TestAioHomematicLightTurnOn | 503 | 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 STATE (reason: send_error)" | assert | string_literal | tests/test_logbook.py | test_falls_back_to_address_when_name_missing | TestOptimisticRollbackDescriber | 173 | 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-SWDO-I" | assert | string_literal | tests/test_recorder.py | no_test_generic_entity_un_recorded | TestRecorder | 94 | 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... | False | assert | bool_literal | tests/test_update.py | test_available_false | TestAioHomematicUpdateProperties | 132 | 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_UNKNOWN | assert | variable | tests/test_recorder.py | no_test_event_entity_un_recorded | TestRecorder | 52 | 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... | obj | assert | variable | tests/test_support.py | test_passthrough | TestGetDataPoint | 123 | 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="Invalid device address format") | pytest.raises | complex_expr | tests/test_support.py | test_invalid_format_raises | TestValidateDeviceAddress | 107 | 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... | True | assert | bool_literal | tests/test_init.py | test_unload_entry | TestUnloadEntry | 223 | 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... | None | assert | none_literal | tests/test_recorder.py | no_test_generic_entity_un_recorded | TestRecorder | 92 | 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... | 21.0 | assert | numeric_literal | tests/test_schedule_ccu_raw_data.py | test_climate_get_paramset_returns_13_slots | TestClimateRawCCUData | 132 | 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... | 0 | assert | numeric_literal | tests/test_diagnostics.py | test_compiles_payload_and_redacts | TestAsyncGetConfigEntryDiagnostics | 131 | 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 ... | {"MONDAY": [{"start": "06:00", "end": "22:00"}]} | assert | collection | tests/test_week_profile_sensor.py | test_extra_state_attributes_default | TestWeekProfileSensor | 215 | null |
SukramJ/homematicip_local | from __future__ import annotations
import json
from pathlib import Path
import subprocess
import sys
from typing import Any
import pytest
def temp_project_structure(tmp_path: Path) -> dict[str, Path]:
"""Create temporary project structure for testing."""
# Create directory structure
custom_components = t... | 0 | assert | numeric_literal | tests/test_check_flow_translations.py | test_valid_flow_title_all_files | TestFlowTitlePlaceholders | 212 | null |
SukramJ/homematicip_local | from __future__ import annotations
import pytest
class TestCCUDataEdgeCases:
def test_minimum_maximum_temperatures(self) -> None:
"""Test valid temperature ranges for Homematic thermostats."""
min_temp = 4.5 # Minimum allowed temperature
max_temp = 30.5 # Maximum allowed temperature
... | 61.0 | assert | numeric_literal | tests/test_schedule_ccu_raw_data.py | test_minimum_maximum_temperatures | TestCCUDataEdgeCases | 308 | 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 ... | "ABC1234567:1" | assert | string_literal | tests/test_week_profile_sensor.py | test_extra_state_attributes_default | TestWeekProfileSensor | 214 | 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
... | True | assert | bool_literal | tests/helper.py | get_data_point_mock | 164 | 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... | [] | assert | collection | tests/test_device_action.py | test_async_get_actions_all_paths | TestAsyncGetActions | 110 | 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... | 0 | assert | numeric_literal | tests/test_config_flow.py | test_get_ccu_data_optional_fields | TestConfigFlowHelpers | 1,149 | null |
SukramJ/homematicip_local | from __future__ import annotations
import pytest
class TestClimateRawCCUData:
@pytest.mark.asyncio
async def test_climate_schedule_13_slot_format(self) -> None:
"""
Test the 13-slot format used by Homematic thermostats.
Climate devices use a specific 13-slot format where:
- E... | 42.0 | assert | numeric_literal | tests/test_schedule_ccu_raw_data.py | test_climate_schedule_13_slot_format | TestClimateRawCCUData | 165 | null |
SukramJ/homematicip_local | from __future__ import annotations
import json
from pathlib import Path
import subprocess
import sys
from typing import Any
import pytest
def temp_project_structure(tmp_path: Path) -> dict[str, Path]:
"""Create temporary project structure for testing."""
# Create directory structure
custom_components = t... | result.stdout | assert | complex_expr | tests/test_check_flow_translations.py | test_missing_host_placeholder | TestFlowTitlePlaceholders | 161 | 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... | 1 | assert | numeric_literal | tests/test_switch.py | test_switch | TestCeSwitch | 48 | 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... | 1 | assert | numeric_literal | tests/test_update.py | test_async_setup_entry_hub_update_callback | TestAsyncSetupEntry | 691 | 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 ... | 546 | assert | numeric_literal | tests/test_week_profile_sensor.py | test_extra_state_attributes_climate | TestWeekProfileSensor | 161 | 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 ... | "default" | assert | string_literal | tests/test_week_profile_sensor.py | test_extra_state_attributes_default | TestWeekProfileSensor | 212 | 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... | 1 | assert | numeric_literal | tests/test_config_flow.py | test_flow_hassio_discovery | TestDiscoveryFlow | 989 | null |
SukramJ/homematicip_local | from __future__ import annotations
import pytest
class TestCCUDataEdgeCases:
def test_weekday_names(self) -> None:
"""Test valid weekday names."""
valid_weekdays = [
"MONDAY",
"TUESDAY",
"WEDNESDAY",
"THURSDAY",
"FRIDAY",
"SA... | 7 | assert | numeric_literal | tests/test_schedule_ccu_raw_data.py | test_weekday_names | TestCCUDataEdgeCases | 345 | 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... | 42 | assert | numeric_literal | tests/test_mqtt.py | test_sysvar_message_handler_calls_central | TestMQTTConsumer | 136 | 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... | "2025.10.5" | assert | string_literal | tests/test_support.py | test_parses_manifest | TestGetAiohomematicVersion | 151 | 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... | 5 | assert | numeric_literal | tests/test_diagnostics.py | test_compiles_payload_and_redacts | TestAsyncGetConfigEntryDiagnostics | 135 | 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_profile_data | assert | variable | tests/test_schedule_end_to_end.py | test_get_schedule_profile_returns_ccu_data | TestClimateScheduleProfileEndToEnd | 198 | 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... | "Kitchen Sensor" | assert | string_literal | tests/test_logbook.py | test_returns_expected_message_for_error_and_resolved | TestDeviceErrorDescriber | 124 | 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... | "sv_logic" | assert | string_literal | tests/test_recorder.py | no_test_sysvar_entity_un_recorded | TestRecorder | 134 | 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... | stats | assert | variable | tests/test_entity_helper.py | test_registry_has_rules | TestEntityHelper | 79 | null |
SukramJ/homematicip_local | from __future__ import annotations
from dataclasses import dataclass
import tempfile
from types import SimpleNamespace
from unittest.mock import AsyncMock, patch
import pytest
import custom_components.homematicip_local as hm_init
class TestAsyncRemoveConfigEntryDevice:
@pytest.mark.asyncio
async def test_f... | False | assert | bool_literal | tests/test_init_extra.py | test_false_without_identifiers | TestAsyncRemoveConfigEntryDevice | 75 | null |
SukramJ/homematicip_local | from __future__ import annotations
import pytest
class TestDocumentationExamplesWithCCUData:
def test_night_setback_ccu_transformation(self) -> None:
"""
Test Night Setback Only from docs with CCU transformation.
Documentation example:
```yaml
base_temperature: 21.0
... | 17.0 * 2 | assert | complex_expr | tests/test_schedule_ccu_raw_data.py | test_night_setback_ccu_transformation | TestDocumentationExamplesWithCCUData | 387 | 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... | 127 | assert | numeric_literal | tests/test_light.py | test_last_brightness_converts_level_to_brightness | TestAioHomematicLightLastBrightness | 677 | null |
SukramJ/homematicip_local | from __future__ import annotations
from collections.abc import Callable
import json
from pathlib import Path
from typing import Any
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from aiohomematic.exceptions import BaseHomematicException
from custom_components.homematicip_local.backup import (
... | [] | assert | collection | tests/test_backup.py | test_returns_empty_for_no_entries | TestAsyncGetBackupAgents | 94 | 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... | 2 | assert | numeric_literal | tests/test_websocket_api.py | test_list_devices | TestWsListDevices | 202 | 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... | {"MONDAY": [{"start": "06:00"}]} | assert | collection | tests/test_set_schedule_service.py | test_get_schedule_calls_wp_dp | TestGetScheduleHandler | 82 | 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... | remove_cb | assert | variable | tests/test_device_trigger.py | test_async_attach_trigger | TestAsyncAttachTrigger | 209 | 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... | 2 | assert | numeric_literal | tests/test_diagnostics.py | test_compiles_payload_and_redacts | TestAsyncGetConfigEntryDiagnostics | 133 | 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 ... | HomeAssistantError, match="does not support schedules") | pytest.raises | complex_expr | tests/test_schedule_end_to_end.py | test_set_schedule_raises_if_no_wp_dp | TestNonClimateSetScheduleEndToEnd | 136 | 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... | True | assert | bool_literal | tests/contract/test_set_schedule_service_contract.py | test_set_schedule_defined | TestScheduleServiceYamlContract | 215 | 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 ... | 7 | assert | numeric_literal | tests/test_week_profile_sensor.py | test_native_value | TestWeekProfileSensor | 267 | 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... | 50 | assert | numeric_literal | tests/test_light.py | test_turn_on_explicit_brightness_overrides_fallback | TestAioHomematicLightTurnOnLastBrightnessFallback | 861 | null |
SukramJ/homematicip_local | from __future__ import annotations
import pytest
class TestCCUDataEdgeCases:
def test_minimum_maximum_temperatures(self) -> None:
"""Test valid temperature ranges for Homematic thermostats."""
min_temp = 4.5 # Minimum allowed temperature
max_temp = 30.5 # Maximum allowed temperature
... | 9.0 | assert | numeric_literal | tests/test_schedule_ccu_raw_data.py | test_minimum_maximum_temperatures | TestCCUDataEdgeCases | 307 | 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... | "Low Bat 1 occurred" | assert | string_literal | tests/test_logbook.py | test_returns_expected_message_for_error_and_resolved | TestDeviceErrorDescriber | 125 | 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 ... | attrs | assert | variable | tests/test_week_profile_sensor.py | test_extra_state_attributes_climate_no_temp | TestWeekProfileSensor | 187 | 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... | 0 | assert | numeric_literal | tests/test_init.py | test_setup_entry | TestSetupEntry | 35 | 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... | ["peer"] | assert | collection | tests/test_services.py | test_registers_and_dispatches_all | TestAsyncSetupServices | 140 | 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 ... | "week_profile" | assert | string_literal | tests/test_week_profile_sensor.py | test_translation_key | TestWeekProfileSensor | 299 | 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
... | 23 * 60 | assert | complex_expr | tests/test_schedule_ccu_raw_data.py | test_weekend_schedule_ccu_transformation | TestDocumentationExamplesWithCCUData | 420 | 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... | False | assert | bool_literal | tests/test_support.py | test_true_and_false | TestIsValidEvent | 58 | null |
SukramJ/homematicip_local | from __future__ import annotations
from collections.abc import Callable
import json
from pathlib import Path
from typing import Any
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from aiohomematic.exceptions import BaseHomematicException
from custom_components.homematicip_local.backup import (
... | 1 | assert | numeric_literal | tests/test_backup.py | test_returns_agent_per_entry | TestAsyncGetBackupAgents | 86 | 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... | 2 | assert | numeric_literal | tests/test_logbook.py | test_registers_two_describers | TestAsyncDescribeEvents | 82 | 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_schedule_data | assert | variable | tests/test_schedule_end_to_end.py | test_get_schedule_dimmer_values | TestNonClimateGetScheduleEndToEnd | 82 | 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... | "FED00000123" | assert | string_literal | tests/test_support.py | test_channel_address_extracts_device_part | TestValidateDeviceAddress | 99 | 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... | cleaned | assert | variable | tests/test_support.py | test_transforms_and_removes | TestCleanupClickEventData | 45 | 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... | 150 | assert | numeric_literal | tests/test_light.py | test_extra_state_attributes_with_group_brightness | TestAioHomematicLightExtraStateAttributes | 279 | 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... | True | assert | bool_literal | tests/test_support.py | test_true_and_false | TestIsValidEvent | 57 | 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... | 1 | assert | numeric_literal | tests/test_light.py | test_async_setup_entry_with_data_points | TestAsyncSetupEntry | 625 | 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 ... | 24 | assert | numeric_literal | tests/test_week_profile_sensor.py | test_extra_state_attributes_default | TestWeekProfileSensor | 213 | 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... | "Low Bat resolved" | assert | string_literal | tests/test_logbook.py | test_returns_expected_message_for_error_and_resolved | TestDeviceErrorDescriber | 149 | 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... | const.INSTANCE_NAME | assert | complex_expr | tests/test_init.py | test_reload_entry | 244 | 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... | params | assert | variable | tests/contract/test_set_schedule_service_contract.py | test_handler_signatures_accept_hass_and_service | TestScheduleServiceHandlerContract | 293 | 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... | "device" | assert | string_literal | tests/test_device_trigger.py | test_trigger_schema_validation | TestTriggerSchema | 99 | 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... | 0 | assert | numeric_literal | tests/test_switch.py | test_switch | TestCeSwitch | 46 | 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... | 10 | assert | numeric_literal | tests/test_diagnostics.py | test_compiles_payload_and_redacts | TestAsyncGetConfigEntryDiagnostics | 132 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.