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 |
|---|---|---|---|---|---|---|---|---|---|
rmartin16/qbittorrent-api | import logging
import re
from os import environ
from unittest.mock import MagicMock, PropertyMock
import pytest
from requests import Response
from requests.adapters import DEFAULT_POOLBLOCK, DEFAULT_POOLSIZE
from qbittorrentapi import APINames, Client, exceptions
from qbittorrentapi._version_support import v
from qbi... | 50 | assert | numeric_literal | tests/test_request.py | test_http_adapter_overrides | 763 | null | |
rmartin16/qbittorrent-api | import errno
import platform
import sys
from time import sleep
import pytest
import requests
from qbittorrentapi import APINames
from qbittorrentapi._version_support import v
from qbittorrentapi.exceptions import (
Conflict409Error,
Forbidden403Error,
InvalidRequest400Error,
TorrentFileError,
Torr... | WebSeedsList([]) | assert | func_call | tests/test_torrents.py | test_add_webseeds | 425 | null | |
rmartin16/qbittorrent-api | import sys
import pytest
from qbittorrentapi import APINames, CookieList
from qbittorrentapi._attrdict import AttrDict
from qbittorrentapi._version_support import v
from qbittorrentapi.app import (
DirectoryContentList,
NetworkInterface,
NetworkInterfaceAddressList,
NetworkInterfaceList,
)
from tests.... | CookieList([]) | assert | func_call | tests/test_app.py | test_cookies | 87 | null | |
rmartin16/qbittorrent-api | import pytest
from qbittorrentapi import Version
from tests.conftest import IS_QBT_DEV, api_version_map
@pytest.mark.skipif(IS_QBT_DEV, reason="testing devel version of qBittorrent")
def test_supported_versions(app_version, api_version):
assert isinstance(Version.supported_api_versions(), set)
assert api_vers... | Version.supported_app_versions() | assert | func_call | tests/test_version.py | test_supported_versions | 12 | null | |
rmartin16/qbittorrent-api | import sys
import pytest
from qbittorrentapi import APINames
from qbittorrentapi.transfer import TransferInfoDictionary
def test_download_limit(client):
client.transfer_set_download_limit(limit=2048)
assert client.transfer_download_limit() == | 2048 | assert | numeric_literal | tests/test_transfer.py | test_download_limit | 72 | null | |
rmartin16/qbittorrent-api | from enum import Enum
import pytest
from qbittorrentapi._attrdict import AttrDict
from qbittorrentapi.definitions import (
Dictionary,
List,
ListEntry,
TorrentState,
TrackerStatus,
)
torrent_all_states = [
"error",
"missingFiles",
"uploading",
"pausedUP",
"stoppedUP",
"que... | 2 | assert | numeric_literal | tests/test_definitions.py | test_dictionary | 168 | null | |
rmartin16/qbittorrent-api | from enum import Enum
import pytest
from qbittorrentapi._attrdict import AttrDict
from qbittorrentapi.definitions import (
Dictionary,
List,
ListEntry,
TorrentState,
TrackerStatus,
)
torrent_all_states = [
"error",
"missingFiles",
"uploading",
"pausedUP",
"stoppedUP",
"que... | 1 | assert | numeric_literal | tests/test_definitions.py | test_dictionary | 165 | null | |
rmartin16/qbittorrent-api | import errno
import platform
import sys
from time import sleep
import pytest
import requests
from qbittorrentapi import APINames
from qbittorrentapi._version_support import v
from qbittorrentapi.exceptions import (
Conflict409Error,
Forbidden403Error,
InvalidRequest400Error,
TorrentFileError,
Torr... | 1 | assert | numeric_literal | tests/test_torrents.py | test_count | 365 | null | |
xaviml/controllerx | from typing import Any, Literal
import pytest
from cx_const import StepperDir
from cx_core import MediaPlayerController, ReleaseHoldController
from cx_core.controller import Controller
from cx_core.feature_support.media_player import MediaPlayerSupport
from pytest import MonkeyPatch
from pytest_mock.plugin import Mock... | "media_player/volume_set") | assert_* | string_literal | tests/unit_tests/cx_core/type/media_player_controller_test.py | test_volume_up | 87 | null | |
xaviml/controllerx | from collections import defaultdict
from typing import Any
import pytest
from appdaemon.adapi import ADAPI
from cx_const import ActionEvent
from cx_core import integration as integration_module
from cx_core.action_type import ActionsMapping
from cx_core.action_type.base import ActionType
from cx_core.controller import... | {1001: "test"} | assert | collection | tests/unit_tests/cx_core/controller_test.py | test_get_default_actions_mapping_happyflow | 379 | null | |
xaviml/controllerx | from typing import Any, Literal
import pytest
from cx_const import StepperDir, StepperMode
from cx_core import LightController, ReleaseHoldController
from cx_core.controller import Controller
from cx_core.feature_support.light import LightSupport
from cx_core.stepper import MinMax, Stepper
from cx_core.stepper.bounce_... | "light/turn_off") | assert_* | string_literal | tests/unit_tests/cx_core/type/light_controller_test.py | test_off | 414 | null | |
xaviml/controllerx | import pytest
from appdaemon.plugins.mqtt.mqttapi import Mqtt
from cx_core.controller import Controller
from cx_core.integration import EventData
from cx_core.integration.mqtt import MQTTIntegration
from pytest_mock.plugin import MockerFixture
from tests.test_utils import wrap_execution
@pytest.mark.parametrize(
... | expected) | assert_* | variable | tests/unit_tests/cx_core/integration/mqtt_test.py | test_callback | 65 | null | |
xaviml/controllerx | from typing import Literal
import pytest
from cx_const import StepperDir
from cx_core.stepper import MinMax
from cx_core.stepper.stop_stepper import StopStepper
@pytest.mark.parametrize(
"min_max, value, steps, direction, expected_value, expected_exceeded",
[
(MinMax(0, 10), 5, 10, StepperDir.DOWN, 4,... | expected_value | assert | variable | tests/unit_tests/cx_core/stepper/stop_stepper_test.py | test_stop_stepper_step | 153 | null | |
xaviml/controllerx | from typing import Any, Literal
import pytest
from cx_const import StepperDir, StepperMode
from cx_core import LightController, ReleaseHoldController
from cx_core.controller import Controller
from cx_core.feature_support.light import LightSupport
from cx_core.stepper import MinMax, Stepper
from cx_core.stepper.bounce_... | expected_name | assert | variable | tests/unit_tests/cx_core/type/light_controller_test.py | test_init | 81 | null | |
xaviml/controllerx | from collections import defaultdict
from typing import Any
import pytest
from appdaemon.adapi import ADAPI
from cx_const import ActionEvent
from cx_core import integration as integration_module
from cx_core.action_type import ActionsMapping
from cx_core.action_type.base import ActionType
from cx_core.controller import... | set(expected) | assert | func_call | tests/unit_tests/cx_core/controller_test.py | test_get_multiple_click_actions | 319 | null | |
xaviml/controllerx | from typing import Any, Literal
import pytest
from cx_const import StepperDir, StepperMode
from cx_core import LightController, ReleaseHoldController
from cx_core.controller import Controller
from cx_core.feature_support.light import LightSupport
from cx_core.stepper import MinMax, Stepper
from cx_core.stepper.bounce_... | expected_remove_transition_check | assert | variable | tests/unit_tests/cx_core/type/light_controller_test.py | test_check_remove_transition | 395 | null | |
xaviml/controllerx | from typing import Any, Literal
import pytest
from cx_const import StepperDir, StepperMode
from cx_core import LightController, ReleaseHoldController
from cx_core.controller import Controller
from cx_core.feature_support.light import LightSupport
from cx_core.stepper import MinMax, Stepper
from cx_core.stepper.bounce_... | expected_output | assert | variable | tests/unit_tests/cx_core/type/light_controller_test.py | test_is_color_supported | 149 | null | |
xaviml/controllerx | from typing import Any, Literal
import pytest
from cx_const import StepperDir
from cx_core import MediaPlayerController, ReleaseHoldController
from cx_core.controller import Controller
from cx_core.feature_support.media_player import MediaPlayerSupport
from pytest import MonkeyPatch
from pytest_mock.plugin import Mock... | "tts.fake_service") | assert_* | string_literal | tests/unit_tests/cx_core/type/media_player_controller_test.py | test_tts | 139 | null | |
xaviml/controllerx | from typing import Any, Literal
import pytest
from cx_const import StepperDir, StepperMode
from cx_core import LightController, ReleaseHoldController
from cx_core.controller import Controller
from cx_core.feature_support.light import LightSupport
from cx_core.stepper import MinMax, Stepper
from cx_core.stepper.bounce_... | expected_calls | assert | variable | tests/unit_tests/cx_core/type/light_controller_test.py | test_click | 657 | null | |
xaviml/controllerx | import pytest
from cx_const import Number, StepperDir
from cx_core.stepper import MinMax, Stepper, StepperOutput
@pytest.mark.parametrize(
"value, direction_input, expected_value",
[
(10, StepperDir.UP, 10),
(0, StepperDir.DOWN, 0),
(0, StepperDir.UP, 0),
(2, StepperDir.DOWN, -2... | expected_value | assert | variable | tests/unit_tests/cx_core/stepper/stepper_test.py | test_apply_sign | 65 | null | |
xaviml/controllerx | from typing import Any, Literal
import pytest
from cx_const import StepperDir
from cx_core import MediaPlayerController, ReleaseHoldController
from cx_core.controller import Controller
from cx_core.feature_support.media_player import MediaPlayerSupport
from pytest import MonkeyPatch
from pytest_mock.plugin import Mock... | f"media_player/volume_{direction_input}") | assert_* | string_literal | tests/unit_tests/cx_core/type/media_player_controller_test.py | test_hold_loop | 192 | null | |
xaviml/controllerx | from typing import Any
import pytest
from cx_const import ActionFunctionWithParams, ActionParams, TypeAction
from cx_core.action_type.predefined_action_type import _get_action, _get_arguments
from cx_core.integration import EventData
from tests.test_utils import fake_fn, wrap_execution
@pytest.mark.parametrize(
... | expected | assert | variable | tests/unit_tests/cx_core/action-types/predefined_action_type_test.py | test_get_action | 24 | null | |
xaviml/controllerx | import pytest
from cx_core.integration import EventData
from cx_devices.philips import HueDimmerController
@pytest.mark.parametrize(
"data, expected_action",
[
({"command": "on_long_release"}, "on_long_release"),
({"command": "down_press"}, "down_press"),
({"command": "off_hold"}, "off_... | expected_action | assert | variable | tests/unit_tests/cx_devices/philips_test.py | test_zha_action_HueDimmerController | 17 | null | |
xaviml/controllerx | from typing import Any
import pytest
from cx_core import CoverController
from cx_core.controller import Controller
from cx_core.feature_support.cover import CoverSupport
from cx_core.type_controller import TypeController
from pytest import MonkeyPatch
from pytest_mock.plugin import MockerFixture
from tests.test_utils... | "cover/stop_cover") | assert_* | string_literal | tests/unit_tests/cx_core/type/cover_controller_test.py | test_stop | 146 | null | |
xaviml/controllerx | import pytest
from appdaemon.plugins.hass.hassapi import Hass
from cx_core.controller import Controller
from cx_core.integration.state import StateIntegration
from pytest_mock.plugin import MockerFixture
@pytest.mark.parametrize("attribute", ["sensor", "entity_id", None])
async def test_listen_changes(
fake_contro... | controller_id) | assert_* | variable | tests/unit_tests/cx_core/integration/state_test.py | test_listen_changes | 21 | null | |
xaviml/controllerx | from typing import Literal
import pytest
from cx_const import StepperDir
from cx_core.stepper import MinMax
from cx_core.stepper.stop_stepper import StopStepper
@pytest.mark.parametrize(
"min_max, value, direction, previous_direction, expected_direction, expected_new_previous_direction",
[
(MinMax(0, ... | expected_new_previous_direction | assert | variable | tests/unit_tests/cx_core/stepper/stop_stepper_test.py | test_stop_stepper_get_direction | 123 | null | |
xaviml/controllerx | from typing import Any
import pytest
from cx_core.controller import Controller
from cx_core.type_controller import Entity, TypeController
from pytest import MonkeyPatch
from pytest_mock.plugin import MockerFixture
from tests.test_utils import fake_fn, wrap_execution
ENTITY_ARG = "my_entity"
ENTITY_NAME = "domain_1.t... | entity_input) | assert_* | variable | tests/unit_tests/cx_core/type_controller_test.py | test_get_entity_state | 162 | null | |
xaviml/controllerx | import pytest
from appdaemon.plugins.mqtt.mqttapi import Mqtt
from cx_core.controller import Controller
from cx_core.integration import EventData
from cx_core.integration.mqtt import MQTTIntegration
from pytest_mock.plugin import MockerFixture
from tests.test_utils import wrap_execution
async def test_listen_changes(... | mqtt_integration.event_callback) | assert_* | complex_expr | tests/unit_tests/cx_core/integration/mqtt_test.py | test_listen_changes | 80 | null | |
xaviml/controllerx | from typing import Any, Literal
import pytest
from cx_const import StepperDir
from cx_core import MediaPlayerController, ReleaseHoldController
from cx_core.controller import Controller
from cx_core.feature_support.media_player import MediaPlayerSupport
from pytest import MonkeyPatch
from pytest_mock.plugin import Mock... | "media_player/media_pause") | assert_* | string_literal | tests/unit_tests/cx_core/type/media_player_controller_test.py | test_pause | 51 | null | |
xaviml/controllerx | from typing import Any
import pytest
from cx_core import ReleaseHoldController
from cx_core.controller import Controller
from pytest import MonkeyPatch
from pytest_mock import MockerFixture
from tests.test_utils import fake_fn
def sut_before_init(mocker: MockerFixture) -> FakeReleaseHoldController:
controller = ... | 500 | assert | numeric_literal | tests/unit_tests/cx_core/release_hold_controller_test.py | test_init | 39 | null | |
xaviml/controllerx | from typing import Any, Literal
import pytest
from cx_const import StepperDir, StepperMode
from cx_core import LightController, ReleaseHoldController
from cx_core.controller import Controller
from cx_core.feature_support.light import LightSupport
from cx_core.stepper import MinMax, Stepper
from cx_core.stepper.bounce_... | expected_attribute | assert | variable | tests/unit_tests/cx_core/type/light_controller_test.py | test_get_attribute | 131 | null | |
xaviml/controllerx | import pytest
from appdaemon.plugins.hass.hassapi import Hass
from cx_core.controller import Controller
from cx_core.integration.state import StateIntegration
from pytest_mock.plugin import MockerFixture
async def test_callback(
fake_controller: Controller,
mocker: MockerFixture,
) -> None:
handle_action_p... | "new_state") | assert_* | string_literal | tests/unit_tests/cx_core/integration/state_test.py | test_callback | 38 | null | |
xaviml/controllerx | from typing import Any
import pytest
from appdaemon.plugins.hass.hassapi import Hass
from cx_core.controller import Controller
from cx_core.integration.shelly import ShellyIntegration
from pytest_mock.plugin import MockerFixture
async def test_listen_changes(
fake_controller: Controller,
mocker: MockerFixture... | "shelly.click") | assert_* | string_literal | tests/unit_tests/cx_core/integration/shelly_test.py | test_listen_changes | 57 | null | |
xaviml/controllerx | from typing import Any
import pytest
from cx_core import ReleaseHoldController
from cx_core.controller import Controller
from pytest import MonkeyPatch
from pytest_mock import MockerFixture
from tests.test_utils import fake_fn
def sut_before_init(mocker: MockerFixture) -> FakeReleaseHoldController:
controller = ... | continue_call | assert | variable | tests/unit_tests/cx_core/release_hold_controller_test.py | test_before_action | 84 | null | |
xaviml/controllerx | import pytest
from cx_core.integration import EventData
from cx_devices.aurora import AUA1ZBR2GWLightController
@pytest.mark.parametrize(
"data, expected_action",
[
({"command": "on"}, "1_toggle"),
({"command": "on", "endpoint_id": 2}, "2_toggle"),
({"command": "off"}, "1_toggle"),
... | expected_action | assert | variable | tests/unit_tests/cx_devices/aurora_test.py | test_zha_action_WXKG01LMLightController | 22 | null | |
xaviml/controllerx | from collections import defaultdict
from typing import Any
import pytest
from appdaemon.adapi import ADAPI
from cx_const import ActionEvent
from cx_core import integration as integration_module
from cx_core.action_type import ActionsMapping
from cx_core.action_type.base import ActionType
from cx_core.controller import... | "This controller does not support integration-test. Use `mapping` to define the actions." | assert | string_literal | tests/unit_tests/cx_core/controller_test.py | test_get_default_actions_mapping_throwing_error | 393 | null | |
xaviml/controllerx | import pytest
from cx_core import SwitchController
from cx_core.type_controller import Entity
from pytest_mock.plugin import MockerFixture
from tests.test_utils import fake_fn
ENTITY_NAME = "switch.test"
async def sut(mocker: MockerFixture) -> SwitchController:
c = SwitchController(**{})
mocker.patch.object(... | "homeassistant/toggle") | assert_* | string_literal | tests/unit_tests/cx_core/type/switch_controller_test.py | test_toggle | 38 | null | |
xaviml/controllerx | from typing import Any
import pytest
from appdaemon.plugins.hass.hassapi import Hass
from cx_core.controller import Controller
from cx_core.integration.shellyforhass import ShellyForHASSIntegration
from pytest_mock.plugin import MockerFixture
async def test_listen_changes(
fake_controller: Controller,
mocker:... | "shellyforhass.click") | assert_* | string_literal | tests/unit_tests/cx_core/integration/shellyforhass_test.py | test_listen_changes | 51 | null | |
xaviml/controllerx | import pytest
from cx_core import SwitchController
from cx_core.type_controller import Entity
from pytest_mock.plugin import MockerFixture
from tests.test_utils import fake_fn
ENTITY_NAME = "switch.test"
async def sut(mocker: MockerFixture) -> SwitchController:
c = SwitchController(**{})
mocker.patch.object(... | "homeassistant/turn_on") | assert_* | string_literal | tests/unit_tests/cx_core/type/switch_controller_test.py | test_turn_on | 22 | null | |
xaviml/controllerx | import json
from typing import Any
import pytest
from appdaemon.plugins.hass.hassapi import Hass
from appdaemon.plugins.mqtt.mqttapi import Mqtt
from cx_core.controller import Controller
from cx_core.integration import EventData
from cx_core.integration.z2m import Z2MIntegration
from pytest_mock import MockerFixture
... | expected_called_with) | assert_* | variable | tests/unit_tests/cx_core/integration/z2m_test.py | test_event_callback | 58 | null | |
xaviml/controllerx | from typing import Any
import pytest
from appdaemon.plugins.hass.hassapi import Hass
from cx_core.controller import Controller
from cx_core.integration.zha import ZHAIntegration
from pytest_mock.plugin import MockerFixture
async def test_listen_changes(
fake_controller: Controller,
mocker: MockerFixture,
) ->... | "zha_event") | assert_* | string_literal | tests/unit_tests/cx_core/integration/zha_test.py | test_listen_changes | 69 | null | |
xaviml/controllerx | from collections import defaultdict
from typing import Any
import pytest
from appdaemon.adapi import ADAPI
from cx_const import ActionEvent
from cx_core import integration as integration_module
from cx_core.action_type import ActionsMapping
from cx_core.action_type.base import ActionType
from cx_core.controller import... | actions_output | assert | variable | tests/unit_tests/cx_core/controller_test.py | test_initialize | 174 | null | |
xaviml/controllerx | from typing import Any
import pytest
from appdaemon.plugins.hass.hassapi import Hass
from cx_core.controller import Controller
from cx_core.integration.zha import ZHAIntegration
from pytest_mock.plugin import MockerFixture
@pytest.mark.parametrize(
"command, args, expected_called_with",
[
("test_comma... | expected_called_with) | assert_* | variable | tests/unit_tests/cx_core/integration/zha_test.py | test_callback | 54 | null | |
xaviml/controllerx | from typing import Literal
import pytest
from cx_const import StepperDir
from cx_core.stepper.index_loop_stepper import IndexLoopStepper
@pytest.mark.parametrize(
"size, value, direction, expected_value",
[
(10, 5, StepperDir.DOWN, 4),
(10, 5, StepperDir.UP, 6),
(10, 1, StepperDir.DOWN... | expected_value | assert | variable | tests/unit_tests/cx_core/stepper/index_loop_stepper_test.py | test_index_loop_stepper | 28 | null | |
xaviml/controllerx | from collections import defaultdict
from typing import Any
import pytest
from appdaemon.adapi import ADAPI
from cx_const import ActionEvent
from cx_core import integration as integration_module
from cx_core.action_type import ActionsMapping
from cx_core.action_type.base import ActionType
from cx_core.controller import... | handle) | assert_* | variable | tests/unit_tests/cx_core/controller_test.py | test_call_action | 468 | null | |
xaviml/controllerx | from typing import Any, Literal
import pytest
from cx_const import StepperDir
from cx_core import MediaPlayerController, ReleaseHoldController
from cx_core.controller import Controller
from cx_core.feature_support.media_player import MediaPlayerSupport
from pytest import MonkeyPatch
from pytest_mock.plugin import Mock... | "media_player/media_next_track") | assert_* | string_literal | tests/unit_tests/cx_core/type/media_player_controller_test.py | test_next_track | 73 | null | |
xaviml/controllerx | from typing import Any, Literal
import pytest
from cx_const import StepperDir
from cx_core import MediaPlayerController, ReleaseHoldController
from cx_core.controller import Controller
from cx_core.feature_support.media_player import MediaPlayerSupport
from pytest import MonkeyPatch
from pytest_mock.plugin import Mock... | "media_player/select_source") | assert_* | string_literal | tests/unit_tests/cx_core/type/media_player_controller_test.py | test_change_source_list | 237 | null | |
xaviml/controllerx | import pytest
from appdaemon.plugins.hass.hassapi import Hass
from cx_core.controller import Controller
from cx_core.integration import EventData
from cx_core.integration.homematic import HomematicIntegration
from pytest_mock.plugin import MockerFixture
async def test_listen_changes(
fake_controller: Controller,
... | set() | assert | func_call | tests/unit_tests/cx_core/integration/homematic_test.py | test_listen_changes | 55 | null | |
xaviml/controllerx | from collections import defaultdict
from typing import Any
import pytest
from appdaemon.adapi import ADAPI
from cx_const import ActionEvent
from cx_core import integration as integration_module
from cx_core.action_type import ActionsMapping
from cx_core.action_type.base import ActionType
from cx_core.controller import... | service) | assert_* | variable | tests/unit_tests/cx_core/controller_test.py | test_call_service | 488 | null | |
xaviml/controllerx | from typing import Any, Literal
import pytest
from cx_const import StepperDir
from cx_core import MediaPlayerController, ReleaseHoldController
from cx_core.controller import Controller
from cx_core.feature_support.media_player import MediaPlayerSupport
from pytest import MonkeyPatch
from pytest_mock.plugin import Mock... | "media_player/media_play_pause") | assert_* | string_literal | tests/unit_tests/cx_core/type/media_player_controller_test.py | test_play_pause | 31 | null | |
xaviml/controllerx | import pytest
from appdaemon.plugins.hass.hassapi import Hass
from cx_core.controller import Controller
from cx_core.integration.deconz import DeCONZIntegration
from pytest_mock.plugin import MockerFixture
from tests.test_utils import wrap_execution
@pytest.mark.parametrize(
"listen_to, expected_id",
[
... | "deconz_event") | assert_* | string_literal | tests/unit_tests/cx_core/integration/deconz_test.py | test_listen_changes | 67 | null | |
xaviml/controllerx | from typing import Literal
import pytest
from cx_const import StepperDir
from cx_core.stepper import MinMax
from cx_core.stepper.stop_stepper import StopStepper
@pytest.mark.parametrize(
"min_max, value, steps, direction, expected_value, expected_exceeded",
[
(MinMax(0, 10), 5, 10, StepperDir.DOWN, 4,... | expected_exceeded | assert | variable | tests/unit_tests/cx_core/stepper/stop_stepper_test.py | test_stop_stepper_step | 154 | null | |
xaviml/controllerx | import json
from typing import Any
import pytest
from appdaemon.plugins.hass.hassapi import Hass
from appdaemon.plugins.mqtt.mqttapi import Mqtt
from cx_core.controller import Controller
from cx_core.integration import EventData
from cx_core.integration.z2m import Z2MIntegration
from pytest_mock import MockerFixture
... | "event.controller_id") | assert_* | string_literal | tests/unit_tests/cx_core/integration/z2m_test.py | test_listen_changes | 113 | null | |
xaviml/controllerx | import pytest
from cx_core import MediaPlayerController
from cx_core.integration import EventData
from cx_devices.aqara import (
MFKZQ01LMLightController,
WXCJKG13LMMediaPlayerController,
WXKG01LMLightController,
WXKG11LMRemoteLightController,
WXKG11LMSensorSwitchLightController,
)
@pytest.mark.par... | expected_action | assert | variable | tests/unit_tests/cx_devices/aqara_test.py | test_zha_action_MFKZQ01LMLightController | 30 | null | |
xaviml/controllerx | from collections import defaultdict
from typing import Any
import pytest
from appdaemon.adapi import ADAPI
from cx_const import ActionEvent
from cx_core import integration as integration_module
from cx_core.action_type import ActionsMapping
from cx_core.action_type.base import ActionType
from cx_core.controller import... | "fake_action") | assert_* | string_literal | tests/unit_tests/cx_core/controller_test.py | test_action_decorator | 50 | null | |
xaviml/controllerx | from collections import defaultdict
from typing import Any
import pytest
from appdaemon.adapi import ADAPI
from cx_const import ActionEvent
from cx_core import integration as integration_module
from cx_core.action_type import ActionsMapping
from cx_core.action_type.base import ActionType
from cx_core.controller import... | expected_calls | assert | variable | tests/unit_tests/cx_core/controller_test.py | test_handle_action | 430 | null | |
xaviml/controllerx | from typing import Any
import pytest
from appdaemon.adapi import ADAPI
from cx_const import PredefinedActionsMapping
from cx_core import (
Controller,
CoverController,
LightController,
MediaPlayerController,
SwitchController,
)
from cx_core.type_controller import Entity, TypeController
from pytest ... | expected_calls | assert | variable | tests/unit_tests/cx_core/custom_controller_test.py | test_custom_controllers | 99 | null | |
xaviml/controllerx | import asyncio
import glob
from collections.abc import Awaitable, Callable, Iterator
from pathlib import Path
from typing import Any, Literal
import pytest
import yaml
from appdaemon.adapi import ADAPI
from cx_core.type_controller import TypeController
from pytest_mock.plugin import MockerFixture
from tests.test_util... | expected_calls_count | assert | variable | tests/integ_tests/integ_test.py | test_integ_configs | 138 | null | |
xaviml/controllerx | from typing import Any, Literal
import pytest
from cx_const import StepperDir, StepperMode
from cx_core import LightController, ReleaseHoldController
from cx_core.controller import Controller
from cx_core.feature_support.light import LightSupport
from cx_core.stepper import MinMax, Stepper
from cx_core.stepper.bounce_... | "light/toggle") | assert_* | string_literal | tests/unit_tests/cx_core/type/light_controller_test.py | test_toggle | 422 | null | |
xaviml/controllerx | import json
from typing import Any
import pytest
from appdaemon.plugins.hass.hassapi import Hass
from appdaemon.plugins.mqtt.mqttapi import Mqtt
from cx_core.controller import Controller
from cx_core.integration import EventData
from cx_core.integration.z2m import Z2MIntegration
from pytest_mock import MockerFixture
... | z2m_integration.event_callback) | assert_* | complex_expr | tests/unit_tests/cx_core/integration/z2m_test.py | test_listen_changes | 106 | null | |
xaviml/controllerx | import importlib
from collections.abc import Callable, Generator
from contextlib import contextmanager
from typing import TYPE_CHECKING, Any, Optional, TypeVar
from unittest.mock import MagicMock
import pytest
from pytest import ExceptionInfo
from pytest_mock.plugin import MockerFixture
T = TypeVar("T")
def fake_fn(... | exception) | pytest.raises | variable | tests/test_utils.py | wrap_execution | 51 | null | |
xaviml/controllerx | import pytest
from cx_core.integration import EventData
from cx_devices.rgb_genie import ZB5122LightController
@pytest.mark.parametrize(
"data, expected_action",
[
({"command": "on"}, "on"),
({"command": "off"}, "off"),
({"command": "stop"}, "stop"),
({"command": "move_to_color"... | expected_action | assert | variable | tests/unit_tests/cx_devices/rgb_genie_test.py | test_zha_action_MFKZQ01LMLightController | 24 | null | |
xaviml/controllerx | from typing import Any
import pytest
from cx_core.controller import Controller
from cx_core.type_controller import Entity, TypeController
from pytest import MonkeyPatch
from pytest_mock.plugin import MockerFixture
from tests.test_utils import fake_fn, wrap_execution
ENTITY_ARG = "my_entity"
ENTITY_NAME = "domain_1.t... | "entity.test") | assert_* | string_literal | tests/unit_tests/cx_core/type_controller_test.py | test_get_entity_state | 168 | null | |
xaviml/controllerx | from typing import Any, Literal
import pytest
from cx_const import StepperDir, StepperMode
from cx_core import LightController, ReleaseHoldController
from cx_core.controller import Controller
from cx_core.feature_support.light import LightSupport
from cx_core.stepper import MinMax, Stepper
from cx_core.stepper.bounce_... | expected_color_mode | assert | variable | tests/unit_tests/cx_core/type/light_controller_test.py | test_init | 82 | null | |
xaviml/controllerx | from typing import Any, Literal
import pytest
from cx_const import StepperDir, StepperMode
from cx_core import LightController, ReleaseHoldController
from cx_core.controller import Controller
from cx_core.feature_support.light import LightSupport
from cx_core.stepper import MinMax, Stepper
from cx_core.stepper.bounce_... | stop_expected | assert | variable | tests/unit_tests/cx_core/type/light_controller_test.py | test_change_light_state | 305 | null | |
xaviml/controllerx | from typing import Any
import pytest
from appdaemon.adapi import ADAPI
from cx_const import PredefinedActionsMapping
from cx_core import (
Controller,
CoverController,
LightController,
MediaPlayerController,
SwitchController,
)
from cx_core.type_controller import Entity, TypeController
from pytest ... | len(expected_calls) | assert | func_call | tests/unit_tests/cx_core/custom_controller_test.py | test_call_service_controller | 165 | null | |
xaviml/controllerx | from typing import Any
import pytest
from appdaemon.plugins.hass.hassapi import Hass
from cx_core.controller import Controller
from cx_core.integration.shellyforhass import ShellyForHASSIntegration
from pytest_mock.plugin import MockerFixture
@pytest.mark.parametrize(
"data, expected",
[
(
... | expected) | assert_* | variable | tests/unit_tests/cx_core/integration/shellyforhass_test.py | test_callback | 38 | null | |
xaviml/controllerx | from typing import Any
import pytest
from appdaemon.plugins.hass.hassapi import Hass
from cx_core.controller import Controller
from cx_core.integration.lutron_caseta import LutronIntegration
from pytest_mock.plugin import MockerFixture
@pytest.mark.parametrize(
"data, expected",
[
(
{
... | expected) | assert_* | variable | tests/unit_tests/cx_core/integration/lutron_test.py | test_callback | 46 | null | |
xaviml/controllerx | import pytest
from cx_core.integration import EventData
from cx_devices.muller_licht import MLI404002LightController
@pytest.mark.parametrize(
"data, expected_action",
[
(
{"command": "on", "args": []},
"on",
),
(
{"command": "off", "args": []},
... | expected_action | assert | variable | tests/unit_tests/cx_devices/muller_licht_test.py | test_zha_action_MLI404002 | 46 | null | |
xaviml/controllerx | from typing import Any, Literal
import pytest
from cx_const import StepperDir, StepperMode
from cx_core import LightController, ReleaseHoldController
from cx_core.controller import Controller
from cx_core.feature_support.light import LightSupport
from cx_core.stepper import MinMax, Stepper
from cx_core.stepper.bounce_... | expected_value_attribute | assert | variable | tests/unit_tests/cx_core/type/light_controller_test.py | test_change_light_state | 306 | null | |
xaviml/controllerx | from typing import Any, Literal
import pytest
from cx_const import StepperDir
from cx_core import MediaPlayerController, ReleaseHoldController
from cx_core.controller import Controller
from cx_core.feature_support.media_player import MediaPlayerSupport
from pytest import MonkeyPatch
from pytest_mock.plugin import Mock... | direction) | assert_* | variable | tests/unit_tests/cx_core/type/media_player_controller_test.py | test_hold | 157 | null | |
xaviml/controllerx | import asyncio
import glob
from collections.abc import Awaitable, Callable, Iterator
from pathlib import Path
from typing import Any, Literal
import pytest
import yaml
from appdaemon.adapi import ADAPI
from cx_core.type_controller import TypeController
from pytest_mock.plugin import MockerFixture
from tests.test_util... | calls) | assert_* | variable | tests/integ_tests/integ_test.py | test_integ_configs | 143 | null | |
xaviml/controllerx | from typing import Literal
import pytest
from cx_const import StepperDir
from cx_core.stepper import MinMax
from cx_core.stepper.bounce_stepper import BounceStepper
@pytest.mark.parametrize(
"min_max, value, steps, direction, expected_value, expected_direction",
[
(MinMax(0, 10), 5, 10, StepperDir.DOW... | expected_value | assert | variable | tests/unit_tests/cx_core/stepper/bounce_stepper_test.py | test_bounce_stepper | 36 | null | |
xaviml/controllerx | import pytest
from cx_const import Number, StepperDir
from cx_core.stepper import MinMax, Stepper, StepperOutput
@pytest.mark.parametrize(
"direction_input, expected_sign",
[
(StepperDir.UP, 1),
(StepperDir.DOWN, -1),
(StepperDir.UP, 1),
(StepperDir.DOWN, -1),
],
)
def test_... | expected_sign | assert | variable | tests/unit_tests/cx_core/stepper/stepper_test.py | test_sign | 48 | null | |
xaviml/controllerx | from collections.abc import Callable, KeysView
import cx_devices as devices_module
import pytest
from cx_const import ActionEvent, DefaultActionsMapping
from cx_core import Controller, ReleaseHoldController
from cx_helper import get_classes
from tests.test_utils import get_controller
def check_mapping(
mapping: ... | None | assert | none_literal | tests/unit_tests/cx_devices/devices_test.py | test_devices | 56 | null | |
xaviml/controllerx | from collections import defaultdict
from typing import Any
import pytest
from appdaemon.adapi import ADAPI
from cx_const import ActionEvent
from cx_core import integration as integration_module
from cx_core.action_type import ActionsMapping
from cx_core.action_type.base import ActionType
from cx_core.controller import... | {"action_key": action_key, "extra": None}) | assert_* | collection | tests/unit_tests/cx_core/controller_test.py | test_call_action | 474 | null | |
xaviml/controllerx | from typing import Literal
import pytest
from cx_const import StepperDir
from cx_core.stepper import MinMax
from cx_core.stepper.stop_stepper import StopStepper
@pytest.mark.parametrize(
"min_max, value, direction, previous_direction, expected_direction, expected_new_previous_direction",
[
(MinMax(0, ... | expected_direction | assert | variable | tests/unit_tests/cx_core/stepper/stop_stepper_test.py | test_stop_stepper_get_direction | 122 | null | |
xaviml/controllerx | import pytest
from appdaemon.plugins.hass.hassapi import Hass
from cx_core.controller import Controller
from cx_core.integration import EventData
from cx_core.integration.homematic import HomematicIntegration
from pytest_mock.plugin import MockerFixture
@pytest.mark.parametrize(
"data, registered_controllers, expe... | expected) | assert_* | variable | tests/unit_tests/cx_core/integration/homematic_test.py | test_callback | 45 | null | |
xaviml/controllerx | from typing import Any
import pytest
from cx_core import CoverController
from cx_core.controller import Controller
from cx_core.feature_support.cover import CoverSupport
from cx_core.type_controller import TypeController
from pytest import MonkeyPatch
from pytest_mock.plugin import MockerFixture
from tests.test_utils... | 0 | assert | numeric_literal | tests/unit_tests/cx_core/type/cover_controller_test.py | test_open | 99 | null | |
xaviml/controllerx | from typing import Literal
import pytest
from cx_const import StepperDir
from cx_core.stepper import MinMax
from cx_core.stepper.loop_stepper import LoopStepper
@pytest.mark.parametrize(
"min_max, value, steps, direction, expected_value",
[
(MinMax(0, 10), 5, 10, StepperDir.DOWN, 4),
(MinMax(0... | expected_value | assert | variable | tests/unit_tests/cx_core/stepper/loop_stepper_test.py | test_loop_stepper | 37 | null | |
xaviml/controllerx | import pytest
from cx_core.feature_support import FeatureSupport
from cx_core.type_controller import Entity, TypeController
@pytest.mark.parametrize(
"number, feature, expected_is_supported",
[
(15, 16, False),
(16, 2, False),
(31, 64, False),
(70, 4, True),
(9, 8, True)... | expected_is_supported | assert | variable | tests/unit_tests/cx_core/feature_support/feature_support_test.py | test_is_supported | 26 | null | |
xaviml/controllerx | from typing import Any
import pytest
from cx_core import CoverController
from cx_core.controller import Controller
from cx_core.feature_support.cover import CoverSupport
from cx_core.type_controller import TypeController
from pytest import MonkeyPatch
from pytest_mock.plugin import MockerFixture
from tests.test_utils... | close_position | assert | variable | tests/unit_tests/cx_core/type/cover_controller_test.py | test_init | 60 | null | |
xaviml/controllerx | from typing import Any
import pytest
from appdaemon.adapi import ADAPI
from cx_const import PredefinedActionsMapping
from cx_core import (
Controller,
CoverController,
LightController,
MediaPlayerController,
SwitchController,
)
from cx_core.type_controller import Entity, TypeController
from pytest ... | expected_service) | assert_* | variable | tests/unit_tests/cx_core/custom_controller_test.py | test_call_service_controller | 167 | null | |
xaviml/controllerx | from typing import Any, Literal
import pytest
from cx_const import StepperDir, StepperMode
from cx_core import LightController, ReleaseHoldController
from cx_core.controller import Controller
from cx_core.feature_support.light import LightSupport
from cx_core.stepper import MinMax, Stepper
from cx_core.stepper.bounce_... | "test_service") | assert_* | string_literal | tests/unit_tests/cx_core/type/light_controller_test.py | test_call_light_service | 354 | null | |
xaviml/controllerx | from collections import defaultdict
from typing import Any
import pytest
from appdaemon.adapi import ADAPI
from cx_const import ActionEvent
from cx_core import integration as integration_module
from cx_core.action_type import ActionsMapping
from cx_core.action_type.base import ActionType
from cx_core.controller import... | expected | assert | variable | tests/unit_tests/cx_core/controller_test.py | test_get_list | 239 | null | |
xaviml/controllerx | from typing import Any
import pytest
from cx_core import CoverController
from cx_core.controller import Controller
from cx_core.feature_support.cover import CoverSupport
from cx_core.type_controller import TypeController
from pytest import MonkeyPatch
from pytest_mock.plugin import MockerFixture
from tests.test_utils... | open_position | assert | variable | tests/unit_tests/cx_core/type/cover_controller_test.py | test_init | 59 | null | |
xaviml/controllerx | from typing import Any
import pytest
from appdaemon.plugins.hass.hassapi import Hass
from cx_core.controller import Controller
from cx_core.integration import EventData
from cx_core.integration.event import EventIntegration
from pytest_mock.plugin import MockerFixture
from tests.test_utils import wrap_execution
@pyt... | f"Template `{action_template}` could not be rendered with data={data}") | assert_* | string_literal | tests/unit_tests/cx_core/integration/event_test.py | test_callback | 64 | null | |
xaviml/controllerx | from typing import Any, Literal
import pytest
from cx_const import StepperDir
from cx_core import MediaPlayerController, ReleaseHoldController
from cx_core.controller import Controller
from cx_core.feature_support.media_player import MediaPlayerSupport
from pytest import MonkeyPatch
from pytest_mock.plugin import Mock... | "media_player/volume_mute") | assert_* | string_literal | tests/unit_tests/cx_core/type/media_player_controller_test.py | test_volume_mute | 121 | null | |
xaviml/controllerx | from collections import defaultdict
from typing import Any
import pytest
from appdaemon.adapi import ADAPI
from cx_const import ActionEvent
from cx_core import integration as integration_module
from cx_core.action_type import ActionsMapping
from cx_core.action_type.base import ActionType
from cx_core.controller import... | delay) | assert_* | variable | tests/unit_tests/cx_core/controller_test.py | test_call_action | 470 | null | |
xaviml/controllerx | import pytest
from cx_core.integration import EventData
from cx_devices.legrand import get_zha_action_LegrandWallController
@pytest.mark.parametrize(
"data, expected_action",
[
({"endpoint_id": 1, "command": "off", "args": []}, "1_off"),
({"endpoint_id": 1, "command": "on", "args": []}, "1_on")... | expected_action | assert | variable | tests/unit_tests/cx_devices/legrand_test.py | test_get_zha_action_LegrandWallController | 23 | null | |
xaviml/controllerx | from typing import Any, Literal
import pytest
from cx_const import StepperDir
from cx_core import MediaPlayerController, ReleaseHoldController
from cx_core.controller import Controller
from cx_core.feature_support.media_player import MediaPlayerSupport
from pytest import MonkeyPatch
from pytest_mock.plugin import Mock... | "media_player/media_play") | assert_* | string_literal | tests/unit_tests/cx_core/type/media_player_controller_test.py | test_play | 41 | null | |
xaviml/controllerx | from typing import Any, Literal
import pytest
from cx_const import StepperDir, StepperMode
from cx_core import LightController, ReleaseHoldController
from cx_core.controller import Controller
from cx_core.feature_support.light import LightSupport
from cx_core.stepper import MinMax, Stepper
from cx_core.stepper.bounce_... | "light/turn_on") | assert_* | string_literal | tests/unit_tests/cx_core/type/light_controller_test.py | test_on | 406 | null | |
xaviml/controllerx | import pytest
from cx_core import SwitchController
from cx_core.type_controller import Entity
from pytest_mock.plugin import MockerFixture
from tests.test_utils import fake_fn
ENTITY_NAME = "switch.test"
async def sut(mocker: MockerFixture) -> SwitchController:
c = SwitchController(**{})
mocker.patch.object(... | "homeassistant/turn_off") | assert_* | string_literal | tests/unit_tests/cx_core/type/switch_controller_test.py | test_turn_off | 30 | null | |
xaviml/controllerx | from collections import defaultdict
from typing import Any
import pytest
from appdaemon.adapi import ADAPI
from cx_const import ActionEvent
from cx_core import integration as integration_module
from cx_core.action_type import ActionsMapping
from cx_core.action_type.base import ActionType
from cx_core.controller import... | len(controller_input) | assert | func_call | tests/unit_tests/cx_core/controller_test.py | test_initialize | 173 | null | |
xaviml/controllerx | from collections import defaultdict
from typing import Any
import pytest
from appdaemon.adapi import ADAPI
from cx_const import ActionEvent
from cx_core import integration as integration_module
from cx_core.action_type import ActionsMapping
from cx_core.action_type.base import ActionType
from cx_core.controller import... | args_expected) | assert_* | variable | tests/unit_tests/cx_core/controller_test.py | test_get_integration | 365 | null | |
xaviml/controllerx | from typing import Any
import pytest
from cx_core import CoverController
from cx_core.controller import Controller
from cx_core.feature_support.cover import CoverSupport
from cx_core.type_controller import TypeController
from pytest import MonkeyPatch
from pytest_mock.plugin import MockerFixture
from tests.test_utils... | expected_service) | assert_* | variable | tests/unit_tests/cx_core/type/cover_controller_test.py | test_open | 95 | null | |
openai/chatgpt-retrieval-plugin | import pytest
from datastore.providers.zilliz_datastore import (
ZillizDataStore,
)
from datastore.providers.milvus_datastore import (
EMBEDDING_FIELD,
)
def zilliz_datastore():
return ZillizDataStore()
@pytest.mark.asyncio
async def test_zilliz(zilliz_datastore):
assert True == | zilliz_datastore.col.has_index() | assert | func_call | tests/datastore/providers/zilliz/test_zilliz_datastore.py | test_zilliz | 26 | null | |
openai/chatgpt-retrieval-plugin | import pytest
from typing import Dict, List
from dotenv import dotenv_values
from datastore.datastore import DataStore
from datastore.providers.azurecosmosdb_datastore import AzureCosmosDBDataStore
from models.models import (
DocumentChunk,
DocumentChunkMetadata,
QueryWithEmbedding,
)
import os
num_lists ... | "doc:deleteDoc:chunk:deleteChunk" | assert | string_literal | tests/datastore/providers/azurecosmosdb/test_azurecosmosdb_datastore.py | test_delete_all | 188 | null | |
openai/chatgpt-retrieval-plugin | from typing import Dict, List
import pytest
import qdrant_client
from qdrant_client.http.models import PayloadSchemaType
from datastore.providers.qdrant_datastore import QdrantDataStore
from models.models import (
DocumentChunk,
DocumentChunkMetadata,
QueryWithEmbedding,
DocumentMetadataFilter,
So... | len(query_results) | assert | func_call | tests/datastore/providers/qdrant/test_qdrant_datastore.py | test_query_returns_all_on_single_query | 140 | null | |
openai/chatgpt-retrieval-plugin | import pytest
from typing import Dict, List
from dotenv import dotenv_values
from datastore.datastore import DataStore
from datastore.providers.azurecosmosdb_datastore import AzureCosmosDBDataStore
from models.models import (
DocumentChunk,
DocumentChunkMetadata,
QueryWithEmbedding,
)
import os
num_lists ... | "doc:first-doc:chunk:first-doc-5" | assert | string_literal | tests/datastore/providers/azurecosmosdb/test_azurecosmosdb_datastore.py | test_query | 125 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.