Replace assert_lists_same with pytest_unordered in integrations h-m (#94901)
This commit is contained in:
parent
c4d7695173
commit
fd822bce56
18 changed files with 61 additions and 59 deletions
|
@ -1,5 +1,6 @@
|
|||
"""The tests for Lock 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,
|
||||
)
|
||||
|
@ -84,7 +84,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(
|
||||
|
@ -133,7 +133,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 Lock device conditions."""
|
||||
import pytest
|
||||
from pytest_unordered import unordered
|
||||
|
||||
import homeassistant.components.automation as automation
|
||||
from homeassistant.components.device_automation import DeviceAutomationType
|
||||
|
@ -19,7 +20,6 @@ from homeassistant.setup import async_setup_component
|
|||
|
||||
from tests.common import (
|
||||
MockConfigEntry,
|
||||
assert_lists_same,
|
||||
async_get_device_automations,
|
||||
async_mock_service,
|
||||
)
|
||||
|
@ -71,7 +71,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(
|
||||
|
@ -125,7 +125,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
|
||||
|
@ -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,
|
||||
|
@ -70,7 +70,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(
|
||||
|
@ -118,7 +118,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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue