mirror of
https://github.com/home-assistant/core.git
synced 2025-08-11 00:25:12 +02:00
Replace assert_lists_same with pytest_unordered in integrations a-f (#94900)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
"""The tests for Alarm control panel device actions."""
|
||||
import pytest
|
||||
from pytest_unordered import unordered
|
||||
|
||||
from homeassistant.components.alarm_control_panel import (
|
||||
DOMAIN,
|
||||
@@ -24,7 +25,6 @@ from homeassistant.setup import async_setup_component
|
||||
|
||||
from tests.common import (
|
||||
MockConfigEntry,
|
||||
assert_lists_same,
|
||||
async_get_device_automation_capabilities,
|
||||
async_get_device_automations,
|
||||
)
|
||||
@@ -127,7 +127,7 @@ async def test_get_actions(
|
||||
actions = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.ACTION, device_entry.id
|
||||
)
|
||||
assert_lists_same(actions, expected_actions)
|
||||
assert actions == unordered(expected_actions)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -176,7 +176,7 @@ async def test_get_actions_hidden_auxiliary(
|
||||
actions = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.ACTION, device_entry.id
|
||||
)
|
||||
assert_lists_same(actions, expected_actions)
|
||||
assert actions == unordered(expected_actions)
|
||||
|
||||
|
||||
async def test_get_actions_arm_night_only(
|
||||
@@ -216,7 +216,7 @@ async def test_get_actions_arm_night_only(
|
||||
actions = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.ACTION, device_entry.id
|
||||
)
|
||||
assert_lists_same(actions, expected_actions)
|
||||
assert actions == unordered(expected_actions)
|
||||
|
||||
|
||||
async def test_get_action_capabilities(
|
||||
|
@@ -1,5 +1,6 @@
|
||||
"""The tests for Alarm control panel device conditions."""
|
||||
import pytest
|
||||
from pytest_unordered import unordered
|
||||
|
||||
from homeassistant.components.alarm_control_panel import (
|
||||
DOMAIN,
|
||||
@@ -23,7 +24,6 @@ from homeassistant.setup import async_setup_component
|
||||
|
||||
from tests.common import (
|
||||
MockConfigEntry,
|
||||
assert_lists_same,
|
||||
async_get_device_automations,
|
||||
async_mock_service,
|
||||
)
|
||||
@@ -133,7 +133,7 @@ async def test_get_conditions(
|
||||
conditions = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.CONDITION, device_entry.id
|
||||
)
|
||||
assert_lists_same(conditions, expected_conditions)
|
||||
assert conditions == unordered(expected_conditions)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -181,7 +181,7 @@ async def test_get_conditions_hidden_auxiliary(
|
||||
conditions = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.CONDITION, device_entry.id
|
||||
)
|
||||
assert_lists_same(conditions, expected_conditions)
|
||||
assert conditions == unordered(expected_conditions)
|
||||
|
||||
|
||||
async def test_if_state(hass: HomeAssistant, calls: list[ServiceCall]) -> None:
|
||||
|
@@ -2,6 +2,7 @@
|
||||
from datetime import timedelta
|
||||
|
||||
import pytest
|
||||
from pytest_unordered import unordered
|
||||
|
||||
from homeassistant.components.alarm_control_panel import (
|
||||
DOMAIN,
|
||||
@@ -26,7 +27,6 @@ import homeassistant.util.dt as dt_util
|
||||
|
||||
from tests.common import (
|
||||
MockConfigEntry,
|
||||
assert_lists_same,
|
||||
async_fire_time_changed,
|
||||
async_get_device_automation_capabilities,
|
||||
async_get_device_automations,
|
||||
@@ -125,7 +125,7 @@ async def test_get_triggers(
|
||||
triggers = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.TRIGGER, device_entry.id
|
||||
)
|
||||
assert_lists_same(triggers, expected_triggers)
|
||||
assert triggers == unordered(expected_triggers)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -173,7 +173,7 @@ async def test_get_triggers_hidden_auxiliary(
|
||||
triggers = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.TRIGGER, device_entry.id
|
||||
)
|
||||
assert_lists_same(triggers, expected_triggers)
|
||||
assert triggers == unordered(expected_triggers)
|
||||
|
||||
|
||||
async def test_get_trigger_capabilities(
|
||||
|
@@ -3,6 +3,7 @@ from datetime import timedelta
|
||||
|
||||
from freezegun import freeze_time
|
||||
import pytest
|
||||
from pytest_unordered import unordered
|
||||
|
||||
import homeassistant.components.automation as automation
|
||||
from homeassistant.components.binary_sensor import DOMAIN, BinarySensorDeviceClass
|
||||
@@ -16,7 +17,6 @@ import homeassistant.util.dt as dt_util
|
||||
|
||||
from tests.common import (
|
||||
MockConfigEntry,
|
||||
assert_lists_same,
|
||||
async_get_device_automation_capabilities,
|
||||
async_get_device_automations,
|
||||
async_mock_service,
|
||||
@@ -75,7 +75,7 @@ async def test_get_conditions(
|
||||
conditions = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.CONDITION, device_entry.id
|
||||
)
|
||||
assert_lists_same(conditions, expected_conditions)
|
||||
assert conditions == unordered(expected_conditions)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -123,7 +123,7 @@ async def test_get_conditions_hidden_auxiliary(
|
||||
conditions = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.CONDITION, device_entry.id
|
||||
)
|
||||
assert_lists_same(conditions, expected_conditions)
|
||||
assert conditions == unordered(expected_conditions)
|
||||
|
||||
|
||||
async def test_get_conditions_no_state(
|
||||
|
@@ -2,6 +2,7 @@
|
||||
from datetime import timedelta
|
||||
|
||||
import pytest
|
||||
from pytest_unordered import unordered
|
||||
|
||||
import homeassistant.components.automation as automation
|
||||
from homeassistant.components.binary_sensor import DOMAIN, BinarySensorDeviceClass
|
||||
@@ -15,7 +16,6 @@ import homeassistant.util.dt as dt_util
|
||||
|
||||
from tests.common import (
|
||||
MockConfigEntry,
|
||||
assert_lists_same,
|
||||
async_fire_time_changed,
|
||||
async_get_device_automation_capabilities,
|
||||
async_get_device_automations,
|
||||
@@ -75,7 +75,7 @@ async def test_get_triggers(
|
||||
triggers = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.TRIGGER, device_entry.id
|
||||
)
|
||||
assert_lists_same(triggers, expected_triggers)
|
||||
assert triggers == unordered(expected_triggers)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -123,7 +123,7 @@ async def test_get_triggers_hidden_auxiliary(
|
||||
triggers = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.TRIGGER, device_entry.id
|
||||
)
|
||||
assert_lists_same(triggers, expected_triggers)
|
||||
assert triggers == unordered(expected_triggers)
|
||||
|
||||
|
||||
async def test_get_triggers_no_state(
|
||||
@@ -168,7 +168,7 @@ async def test_get_triggers_no_state(
|
||||
triggers = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.TRIGGER, device_entry.id
|
||||
)
|
||||
assert_lists_same(triggers, expected_triggers)
|
||||
assert triggers == unordered(expected_triggers)
|
||||
|
||||
|
||||
async def test_get_trigger_capabilities(
|
||||
|
@@ -1,5 +1,6 @@
|
||||
"""The tests for Button device actions."""
|
||||
import pytest
|
||||
from pytest_unordered import unordered
|
||||
|
||||
from homeassistant.components import automation
|
||||
from homeassistant.components.button import DOMAIN
|
||||
@@ -11,7 +12,6 @@ from homeassistant.setup import async_setup_component
|
||||
|
||||
from tests.common import (
|
||||
MockConfigEntry,
|
||||
assert_lists_same,
|
||||
async_get_device_automations,
|
||||
async_mock_service,
|
||||
)
|
||||
@@ -44,7 +44,7 @@ async def test_get_actions(
|
||||
actions = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.ACTION, device_entry.id
|
||||
)
|
||||
assert_lists_same(actions, expected_actions)
|
||||
assert actions == unordered(expected_actions)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -92,7 +92,7 @@ async def test_get_actions_hidden_auxiliary(
|
||||
actions = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.ACTION, device_entry.id
|
||||
)
|
||||
assert_lists_same(actions, expected_actions)
|
||||
assert actions == unordered(expected_actions)
|
||||
|
||||
|
||||
async def test_action(hass: HomeAssistant) -> None:
|
||||
|
@@ -2,6 +2,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
from pytest_unordered import unordered
|
||||
|
||||
from homeassistant.components import automation
|
||||
from homeassistant.components.button import DOMAIN
|
||||
@@ -13,7 +14,6 @@ from homeassistant.setup import async_setup_component
|
||||
|
||||
from tests.common import (
|
||||
MockConfigEntry,
|
||||
assert_lists_same,
|
||||
async_get_device_automations,
|
||||
async_mock_service,
|
||||
)
|
||||
@@ -53,7 +53,7 @@ async def test_get_triggers(
|
||||
triggers = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.TRIGGER, device_entry.id
|
||||
)
|
||||
assert_lists_same(triggers, expected_triggers)
|
||||
assert triggers == unordered(expected_triggers)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -101,7 +101,7 @@ async def test_get_triggers_hidden_auxiliary(
|
||||
triggers = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.TRIGGER, device_entry.id
|
||||
)
|
||||
assert_lists_same(triggers, expected_triggers)
|
||||
assert triggers == unordered(expected_triggers)
|
||||
|
||||
|
||||
async def test_if_fires_on_state_change(hass: HomeAssistant, calls) -> None:
|
||||
|
@@ -1,5 +1,6 @@
|
||||
"""The tests for Climate device actions."""
|
||||
import pytest
|
||||
from pytest_unordered import unordered
|
||||
import voluptuous_serialize
|
||||
|
||||
import homeassistant.components.automation as automation
|
||||
@@ -17,7 +18,6 @@ from homeassistant.setup import async_setup_component
|
||||
|
||||
from tests.common import (
|
||||
MockConfigEntry,
|
||||
assert_lists_same,
|
||||
async_get_device_automations,
|
||||
async_mock_service,
|
||||
)
|
||||
@@ -91,7 +91,7 @@ async def test_get_actions(
|
||||
actions = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.ACTION, device_entry.id
|
||||
)
|
||||
assert_lists_same(actions, expected_actions)
|
||||
assert actions == unordered(expected_actions)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -140,7 +140,7 @@ async def test_get_actions_hidden_auxiliary(
|
||||
actions = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.ACTION, device_entry.id
|
||||
)
|
||||
assert_lists_same(actions, expected_actions)
|
||||
assert actions == unordered(expected_actions)
|
||||
|
||||
|
||||
async def test_action(hass: HomeAssistant) -> None:
|
||||
|
@@ -1,5 +1,6 @@
|
||||
"""The tests for Climate device conditions."""
|
||||
import pytest
|
||||
from pytest_unordered import unordered
|
||||
import voluptuous_serialize
|
||||
|
||||
import homeassistant.components.automation as automation
|
||||
@@ -17,7 +18,6 @@ from homeassistant.setup import async_setup_component
|
||||
|
||||
from tests.common import (
|
||||
MockConfigEntry,
|
||||
assert_lists_same,
|
||||
async_get_device_automations,
|
||||
async_mock_service,
|
||||
)
|
||||
@@ -95,7 +95,7 @@ async def test_get_conditions(
|
||||
conditions = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.CONDITION, device_entry.id
|
||||
)
|
||||
assert_lists_same(conditions, expected_conditions)
|
||||
assert conditions == unordered(expected_conditions)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -143,7 +143,7 @@ async def test_get_conditions_hidden_auxiliary(
|
||||
conditions = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.CONDITION, device_entry.id
|
||||
)
|
||||
assert_lists_same(conditions, expected_conditions)
|
||||
assert conditions == unordered(expected_conditions)
|
||||
|
||||
|
||||
async def test_if_state(hass: HomeAssistant, calls) -> None:
|
||||
|
@@ -1,5 +1,6 @@
|
||||
"""The tests for Climate device triggers."""
|
||||
import pytest
|
||||
from pytest_unordered import unordered
|
||||
import voluptuous_serialize
|
||||
|
||||
import homeassistant.components.automation as automation
|
||||
@@ -23,7 +24,6 @@ from homeassistant.setup import async_setup_component
|
||||
|
||||
from tests.common import (
|
||||
MockConfigEntry,
|
||||
assert_lists_same,
|
||||
async_get_device_automations,
|
||||
async_mock_service,
|
||||
)
|
||||
@@ -83,7 +83,7 @@ async def test_get_triggers(
|
||||
triggers = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.TRIGGER, device_entry.id
|
||||
)
|
||||
assert_lists_same(triggers, expected_triggers)
|
||||
assert triggers == unordered(expected_triggers)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -145,7 +145,7 @@ async def test_get_triggers_hidden_auxiliary(
|
||||
triggers = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.TRIGGER, device_entry.id
|
||||
)
|
||||
assert_lists_same(triggers, expected_triggers)
|
||||
assert triggers == unordered(expected_triggers)
|
||||
|
||||
|
||||
async def test_if_fires_on_state_change(hass: HomeAssistant, calls) -> None:
|
||||
|
@@ -1,5 +1,6 @@
|
||||
"""The tests for Cover device actions."""
|
||||
import pytest
|
||||
from pytest_unordered import unordered
|
||||
|
||||
import homeassistant.components.automation as automation
|
||||
from homeassistant.components.cover import DOMAIN, CoverEntityFeature
|
||||
@@ -12,7 +13,6 @@ from homeassistant.setup import async_setup_component
|
||||
|
||||
from tests.common import (
|
||||
MockConfigEntry,
|
||||
assert_lists_same,
|
||||
async_get_device_automation_capabilities,
|
||||
async_get_device_automations,
|
||||
async_mock_service,
|
||||
@@ -88,7 +88,7 @@ async def test_get_actions(
|
||||
actions = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.ACTION, device_entry.id
|
||||
)
|
||||
assert_lists_same(actions, expected_actions)
|
||||
assert actions == unordered(expected_actions)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -137,7 +137,7 @@ async def test_get_actions_hidden_auxiliary(
|
||||
actions = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.ACTION, device_entry.id
|
||||
)
|
||||
assert_lists_same(actions, expected_actions)
|
||||
assert actions == unordered(expected_actions)
|
||||
|
||||
|
||||
async def test_get_action_capabilities(
|
||||
|
@@ -1,5 +1,6 @@
|
||||
"""The tests for Cover device conditions."""
|
||||
import pytest
|
||||
from pytest_unordered import unordered
|
||||
|
||||
import homeassistant.components.automation as automation
|
||||
from homeassistant.components.cover import DOMAIN, CoverEntityFeature
|
||||
@@ -20,7 +21,6 @@ from homeassistant.setup import async_setup_component
|
||||
|
||||
from tests.common import (
|
||||
MockConfigEntry,
|
||||
assert_lists_same,
|
||||
async_get_device_automation_capabilities,
|
||||
async_get_device_automations,
|
||||
async_mock_service,
|
||||
@@ -117,7 +117,7 @@ async def test_get_conditions(
|
||||
conditions = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.CONDITION, device_entry.id
|
||||
)
|
||||
assert_lists_same(conditions, expected_conditions)
|
||||
assert conditions == unordered(expected_conditions)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -166,7 +166,7 @@ async def test_get_conditions_hidden_auxiliary(
|
||||
conditions = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.CONDITION, device_entry.id
|
||||
)
|
||||
assert_lists_same(conditions, expected_conditions)
|
||||
assert conditions == unordered(expected_conditions)
|
||||
|
||||
|
||||
async def test_get_condition_capabilities(
|
||||
|
@@ -2,6 +2,7 @@
|
||||
from datetime import timedelta
|
||||
|
||||
import pytest
|
||||
from pytest_unordered import unordered
|
||||
|
||||
import homeassistant.components.automation as automation
|
||||
from homeassistant.components.cover import DOMAIN, CoverEntityFeature
|
||||
@@ -22,7 +23,6 @@ import homeassistant.util.dt as dt_util
|
||||
|
||||
from tests.common import (
|
||||
MockConfigEntry,
|
||||
assert_lists_same,
|
||||
async_fire_time_changed,
|
||||
async_get_device_automation_capabilities,
|
||||
async_get_device_automations,
|
||||
@@ -118,7 +118,7 @@ async def test_get_triggers(
|
||||
triggers = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.TRIGGER, device_entry.id
|
||||
)
|
||||
assert_lists_same(triggers, expected_triggers)
|
||||
assert triggers == unordered(expected_triggers)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -167,7 +167,7 @@ async def test_get_triggers_hidden_auxiliary(
|
||||
triggers = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.TRIGGER, device_entry.id
|
||||
)
|
||||
assert_lists_same(triggers, expected_triggers)
|
||||
assert triggers == unordered(expected_triggers)
|
||||
|
||||
|
||||
async def test_get_trigger_capabilities(
|
||||
|
@@ -2,6 +2,7 @@
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
import pytest
|
||||
from pytest_unordered import unordered
|
||||
|
||||
from homeassistant.components.automation import DOMAIN as AUTOMATION_DOMAIN
|
||||
from homeassistant.components.binary_sensor import DOMAIN as BINARY_SENSOR_DOMAIN
|
||||
@@ -32,7 +33,6 @@ from homeassistant.setup import async_setup_component
|
||||
from .test_gateway import DECONZ_WEB_REQUEST, setup_deconz_integration
|
||||
|
||||
from tests.common import (
|
||||
assert_lists_same,
|
||||
async_get_device_automations,
|
||||
async_mock_service,
|
||||
)
|
||||
@@ -148,7 +148,7 @@ async def test_get_triggers(
|
||||
},
|
||||
]
|
||||
|
||||
assert_lists_same(triggers, expected_triggers)
|
||||
assert triggers == unordered(expected_triggers)
|
||||
|
||||
|
||||
async def test_get_triggers_for_alarm_event(
|
||||
@@ -240,7 +240,7 @@ async def test_get_triggers_for_alarm_event(
|
||||
},
|
||||
]
|
||||
|
||||
assert_lists_same(triggers, expected_triggers)
|
||||
assert triggers == unordered(expected_triggers)
|
||||
|
||||
|
||||
async def test_get_triggers_manage_unsupported_remotes(
|
||||
@@ -283,7 +283,7 @@ async def test_get_triggers_manage_unsupported_remotes(
|
||||
|
||||
expected_triggers = []
|
||||
|
||||
assert_lists_same(triggers, expected_triggers)
|
||||
assert triggers == unordered(expected_triggers)
|
||||
|
||||
|
||||
async def test_functional_device_trigger(
|
||||
|
@@ -1,5 +1,6 @@
|
||||
"""The tests for Device tracker device conditions."""
|
||||
import pytest
|
||||
from pytest_unordered import unordered
|
||||
|
||||
import homeassistant.components.automation as automation
|
||||
from homeassistant.components.device_automation import DeviceAutomationType
|
||||
@@ -12,7 +13,6 @@ from homeassistant.setup import async_setup_component
|
||||
|
||||
from tests.common import (
|
||||
MockConfigEntry,
|
||||
assert_lists_same,
|
||||
async_get_device_automations,
|
||||
async_mock_service,
|
||||
)
|
||||
@@ -58,7 +58,7 @@ async def test_get_conditions(
|
||||
conditions = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.CONDITION, device_entry.id
|
||||
)
|
||||
assert_lists_same(conditions, expected_conditions)
|
||||
assert conditions == unordered(expected_conditions)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -106,7 +106,7 @@ async def test_get_conditions_hidden_auxiliary(
|
||||
conditions = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.CONDITION, device_entry.id
|
||||
)
|
||||
assert_lists_same(conditions, expected_conditions)
|
||||
assert conditions == unordered(expected_conditions)
|
||||
|
||||
|
||||
async def test_if_state(hass: HomeAssistant, calls) -> None:
|
||||
|
@@ -1,5 +1,6 @@
|
||||
"""The tests for Device Tracker device triggers."""
|
||||
import pytest
|
||||
from pytest_unordered import unordered
|
||||
import voluptuous_serialize
|
||||
|
||||
import homeassistant.components.automation as automation
|
||||
@@ -18,7 +19,6 @@ from homeassistant.setup import async_setup_component
|
||||
|
||||
from tests.common import (
|
||||
MockConfigEntry,
|
||||
assert_lists_same,
|
||||
async_get_device_automations,
|
||||
async_mock_service,
|
||||
)
|
||||
@@ -90,7 +90,7 @@ async def test_get_triggers(
|
||||
triggers = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.TRIGGER, device_entry.id
|
||||
)
|
||||
assert_lists_same(triggers, expected_triggers)
|
||||
assert triggers == unordered(expected_triggers)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -138,7 +138,7 @@ async def test_get_triggers_hidden_auxiliary(
|
||||
triggers = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.TRIGGER, device_entry.id
|
||||
)
|
||||
assert_lists_same(triggers, expected_triggers)
|
||||
assert triggers == unordered(expected_triggers)
|
||||
|
||||
|
||||
async def test_if_fires_on_zone_change(hass: HomeAssistant, calls) -> None:
|
||||
|
@@ -1,5 +1,6 @@
|
||||
"""The tests for Fan device actions."""
|
||||
import pytest
|
||||
from pytest_unordered import unordered
|
||||
|
||||
import homeassistant.components.automation as automation
|
||||
from homeassistant.components.device_automation import DeviceAutomationType
|
||||
@@ -12,7 +13,6 @@ from homeassistant.setup import async_setup_component
|
||||
|
||||
from tests.common import (
|
||||
MockConfigEntry,
|
||||
assert_lists_same,
|
||||
async_get_device_automations,
|
||||
async_mock_service,
|
||||
)
|
||||
@@ -52,7 +52,7 @@ async def test_get_actions(
|
||||
actions = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.ACTION, device_entry.id
|
||||
)
|
||||
assert_lists_same(actions, expected_actions)
|
||||
assert actions == unordered(expected_actions)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -100,7 +100,7 @@ async def test_get_actions_hidden_auxiliary(
|
||||
actions = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.ACTION, device_entry.id
|
||||
)
|
||||
assert_lists_same(actions, expected_actions)
|
||||
assert actions == unordered(expected_actions)
|
||||
|
||||
|
||||
async def test_action(hass: HomeAssistant) -> None:
|
||||
|
@@ -1,5 +1,6 @@
|
||||
"""The tests for Fan device conditions."""
|
||||
import pytest
|
||||
from pytest_unordered import unordered
|
||||
|
||||
import homeassistant.components.automation as automation
|
||||
from homeassistant.components.device_automation import DeviceAutomationType
|
||||
@@ -12,7 +13,6 @@ from homeassistant.setup import async_setup_component
|
||||
|
||||
from tests.common import (
|
||||
MockConfigEntry,
|
||||
assert_lists_same,
|
||||
async_get_device_automations,
|
||||
async_mock_service,
|
||||
)
|
||||
@@ -58,7 +58,7 @@ async def test_get_conditions(
|
||||
conditions = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.CONDITION, device_entry.id
|
||||
)
|
||||
assert_lists_same(conditions, expected_conditions)
|
||||
assert conditions == unordered(expected_conditions)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -106,7 +106,7 @@ async def test_get_conditions_hidden_auxiliary(
|
||||
conditions = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.CONDITION, device_entry.id
|
||||
)
|
||||
assert_lists_same(conditions, expected_conditions)
|
||||
assert conditions == unordered(expected_conditions)
|
||||
|
||||
|
||||
async def test_if_state(hass: HomeAssistant, calls) -> None:
|
||||
|
@@ -2,6 +2,7 @@
|
||||
from datetime import timedelta
|
||||
|
||||
import pytest
|
||||
from pytest_unordered import unordered
|
||||
|
||||
import homeassistant.components.automation as automation
|
||||
from homeassistant.components.device_automation import DeviceAutomationType
|
||||
@@ -15,7 +16,6 @@ import homeassistant.util.dt as dt_util
|
||||
|
||||
from tests.common import (
|
||||
MockConfigEntry,
|
||||
assert_lists_same,
|
||||
async_fire_time_changed,
|
||||
async_get_device_automation_capabilities,
|
||||
async_get_device_automations,
|
||||
@@ -63,7 +63,7 @@ async def test_get_triggers(
|
||||
triggers = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.TRIGGER, device_entry.id
|
||||
)
|
||||
assert_lists_same(triggers, expected_triggers)
|
||||
assert triggers == unordered(expected_triggers)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -111,7 +111,7 @@ async def test_get_triggers_hidden_auxiliary(
|
||||
triggers = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.TRIGGER, device_entry.id
|
||||
)
|
||||
assert_lists_same(triggers, expected_triggers)
|
||||
assert triggers == unordered(expected_triggers)
|
||||
|
||||
|
||||
async def test_get_trigger_capabilities(
|
||||
|
Reference in New Issue
Block a user