mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 15:17:35 +00:00
Only get state once for all August sensor-tests (#100721)
This commit is contained in:
parent
964192d246
commit
debee28856
@ -149,34 +149,15 @@ async def test_lock_operator_bluetooth(hass: HomeAssistant) -> None:
|
|||||||
"sensor.online_with_doorsense_name_operator"
|
"sensor.online_with_doorsense_name_operator"
|
||||||
)
|
)
|
||||||
assert lock_operator_sensor
|
assert lock_operator_sensor
|
||||||
assert (
|
|
||||||
hass.states.get("sensor.online_with_doorsense_name_operator").state
|
state = hass.states.get("sensor.online_with_doorsense_name_operator")
|
||||||
== "Your favorite elven princess"
|
assert state.state == "Your favorite elven princess"
|
||||||
)
|
assert state.attributes["manual"] is False
|
||||||
assert (
|
assert state.attributes["tag"] is False
|
||||||
hass.states.get("sensor.online_with_doorsense_name_operator").attributes[
|
assert state.attributes["remote"] is False
|
||||||
"remote"
|
assert state.attributes["keypad"] is False
|
||||||
]
|
assert state.attributes["autorelock"] is False
|
||||||
is False
|
assert state.attributes["method"] == "mobile"
|
||||||
)
|
|
||||||
assert (
|
|
||||||
hass.states.get("sensor.online_with_doorsense_name_operator").attributes[
|
|
||||||
"keypad"
|
|
||||||
]
|
|
||||||
is False
|
|
||||||
)
|
|
||||||
assert (
|
|
||||||
hass.states.get("sensor.online_with_doorsense_name_operator").attributes[
|
|
||||||
"autorelock"
|
|
||||||
]
|
|
||||||
is False
|
|
||||||
)
|
|
||||||
assert (
|
|
||||||
hass.states.get("sensor.online_with_doorsense_name_operator").attributes[
|
|
||||||
"method"
|
|
||||||
]
|
|
||||||
== "mobile"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
async def test_lock_operator_keypad(hass: HomeAssistant) -> None:
|
async def test_lock_operator_keypad(hass: HomeAssistant) -> None:
|
||||||
@ -193,34 +174,15 @@ async def test_lock_operator_keypad(hass: HomeAssistant) -> None:
|
|||||||
"sensor.online_with_doorsense_name_operator"
|
"sensor.online_with_doorsense_name_operator"
|
||||||
)
|
)
|
||||||
assert lock_operator_sensor
|
assert lock_operator_sensor
|
||||||
assert (
|
|
||||||
hass.states.get("sensor.online_with_doorsense_name_operator").state
|
state = hass.states.get("sensor.online_with_doorsense_name_operator")
|
||||||
== "Your favorite elven princess"
|
assert state.state == "Your favorite elven princess"
|
||||||
)
|
assert state.attributes["manual"] is False
|
||||||
assert (
|
assert state.attributes["tag"] is False
|
||||||
hass.states.get("sensor.online_with_doorsense_name_operator").attributes[
|
assert state.attributes["remote"] is False
|
||||||
"remote"
|
assert state.attributes["keypad"] is True
|
||||||
]
|
assert state.attributes["autorelock"] is False
|
||||||
is False
|
assert state.attributes["method"] == "keypad"
|
||||||
)
|
|
||||||
assert (
|
|
||||||
hass.states.get("sensor.online_with_doorsense_name_operator").attributes[
|
|
||||||
"keypad"
|
|
||||||
]
|
|
||||||
is True
|
|
||||||
)
|
|
||||||
assert (
|
|
||||||
hass.states.get("sensor.online_with_doorsense_name_operator").attributes[
|
|
||||||
"autorelock"
|
|
||||||
]
|
|
||||||
is False
|
|
||||||
)
|
|
||||||
assert (
|
|
||||||
hass.states.get("sensor.online_with_doorsense_name_operator").attributes[
|
|
||||||
"method"
|
|
||||||
]
|
|
||||||
== "keypad"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
async def test_lock_operator_remote(hass: HomeAssistant) -> None:
|
async def test_lock_operator_remote(hass: HomeAssistant) -> None:
|
||||||
@ -235,34 +197,15 @@ async def test_lock_operator_remote(hass: HomeAssistant) -> None:
|
|||||||
"sensor.online_with_doorsense_name_operator"
|
"sensor.online_with_doorsense_name_operator"
|
||||||
)
|
)
|
||||||
assert lock_operator_sensor
|
assert lock_operator_sensor
|
||||||
assert (
|
|
||||||
hass.states.get("sensor.online_with_doorsense_name_operator").state
|
state = hass.states.get("sensor.online_with_doorsense_name_operator")
|
||||||
== "Your favorite elven princess"
|
assert state.state == "Your favorite elven princess"
|
||||||
)
|
assert state.attributes["manual"] is False
|
||||||
assert (
|
assert state.attributes["tag"] is False
|
||||||
hass.states.get("sensor.online_with_doorsense_name_operator").attributes[
|
assert state.attributes["remote"] is True
|
||||||
"remote"
|
assert state.attributes["keypad"] is False
|
||||||
]
|
assert state.attributes["autorelock"] is False
|
||||||
is True
|
assert state.attributes["method"] == "remote"
|
||||||
)
|
|
||||||
assert (
|
|
||||||
hass.states.get("sensor.online_with_doorsense_name_operator").attributes[
|
|
||||||
"keypad"
|
|
||||||
]
|
|
||||||
is False
|
|
||||||
)
|
|
||||||
assert (
|
|
||||||
hass.states.get("sensor.online_with_doorsense_name_operator").attributes[
|
|
||||||
"autorelock"
|
|
||||||
]
|
|
||||||
is False
|
|
||||||
)
|
|
||||||
assert (
|
|
||||||
hass.states.get("sensor.online_with_doorsense_name_operator").attributes[
|
|
||||||
"method"
|
|
||||||
]
|
|
||||||
== "remote"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
async def test_lock_operator_manual(hass: HomeAssistant) -> None:
|
async def test_lock_operator_manual(hass: HomeAssistant) -> None:
|
||||||
@ -303,34 +246,15 @@ async def test_lock_operator_autorelock(hass: HomeAssistant) -> None:
|
|||||||
"sensor.online_with_doorsense_name_operator"
|
"sensor.online_with_doorsense_name_operator"
|
||||||
)
|
)
|
||||||
assert lock_operator_sensor
|
assert lock_operator_sensor
|
||||||
assert (
|
|
||||||
hass.states.get("sensor.online_with_doorsense_name_operator").state
|
state = hass.states.get("sensor.online_with_doorsense_name_operator")
|
||||||
== "Auto Relock"
|
assert state.state == "Auto Relock"
|
||||||
)
|
assert state.attributes["manual"] is False
|
||||||
assert (
|
assert state.attributes["tag"] is False
|
||||||
hass.states.get("sensor.online_with_doorsense_name_operator").attributes[
|
assert state.attributes["remote"] is False
|
||||||
"remote"
|
assert state.attributes["keypad"] is False
|
||||||
]
|
assert state.attributes["autorelock"] is True
|
||||||
is False
|
assert state.attributes["method"] == "autorelock"
|
||||||
)
|
|
||||||
assert (
|
|
||||||
hass.states.get("sensor.online_with_doorsense_name_operator").attributes[
|
|
||||||
"keypad"
|
|
||||||
]
|
|
||||||
is False
|
|
||||||
)
|
|
||||||
assert (
|
|
||||||
hass.states.get("sensor.online_with_doorsense_name_operator").attributes[
|
|
||||||
"autorelock"
|
|
||||||
]
|
|
||||||
is True
|
|
||||||
)
|
|
||||||
assert (
|
|
||||||
hass.states.get("sensor.online_with_doorsense_name_operator").attributes[
|
|
||||||
"method"
|
|
||||||
]
|
|
||||||
== "autorelock"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
async def test_unlock_operator_manual(hass: HomeAssistant) -> None:
|
async def test_unlock_operator_manual(hass: HomeAssistant) -> None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user