Skip to content

Commit

Permalink
Fix assert order in intent tests (#87036)
Browse files Browse the repository at this point in the history
Fix assert order
  • Loading branch information
synesthesiam authored Jan 31, 2023
1 parent 6845073 commit 52cf6c7
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions tests/helpers/test_intent.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,28 +53,28 @@ async def test_async_match_states(hass):
)

# Match on name
assert [state1] == list(
assert list(
intent.async_match_states(hass, name="kitchen light", states=[state1, state2])
)
) == [state1]

# Test alias
assert [state2] == list(
assert list(
intent.async_match_states(hass, name="kill switch", states=[state1, state2])
)
) == [state2]

# Name + area
assert [state1] == list(
assert list(
intent.async_match_states(
hass, name="kitchen light", area_name="kitchen", states=[state1, state2]
)
)
) == [state1]

# Test area alias
assert [state1] == list(
assert list(
intent.async_match_states(
hass, name="kitchen light", area_name="food room", states=[state1, state2]
)
)
) == [state1]

# Wrong area
assert not list(
Expand All @@ -84,21 +84,21 @@ async def test_async_match_states(hass):
)

# Domain + area
assert [state2] == list(
assert list(
intent.async_match_states(
hass, domains={"switch"}, area_name="bedroom", states=[state1, state2]
)
)
) == [state2]

# Device class + area
assert [state2] == list(
assert list(
intent.async_match_states(
hass,
device_classes={SwitchDeviceClass.OUTLET},
area_name="bedroom",
states=[state1, state2],
)
)
) == [state2]


async def test_match_device_area(hass):
Expand Down Expand Up @@ -130,14 +130,14 @@ async def test_match_device_area(hass):
entities.async_update_entity(state2.entity_id, area_id=area_bedroom.id)

# Match on area/domain
assert [state1] == list(
assert list(
intent.async_match_states(
hass,
domains={"light"},
area_name="kitchen",
states=[state1, state2, state3],
)
)
) == [state1]


def test_async_validate_slots():
Expand Down

0 comments on commit 52cf6c7

Please sign in to comment.