mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-12-24 20:35:55 +00:00
Move write of core state to executor (#5720)
This commit is contained in:
@@ -11,7 +11,7 @@ from supervisor.resolution.evaluations.privileged import EvaluatePrivileged
|
||||
async def test_evaluation(coresys: CoreSys):
|
||||
"""Test evaluation."""
|
||||
privileged = EvaluatePrivileged(coresys)
|
||||
coresys.core.state = CoreState.INITIALIZE
|
||||
await coresys.core.set_state(CoreState.INITIALIZE)
|
||||
|
||||
assert privileged.reason not in coresys.resolution.unsupported
|
||||
|
||||
@@ -37,13 +37,13 @@ async def test_did_run(coresys: CoreSys):
|
||||
return_value=None,
|
||||
) as evaluate:
|
||||
for state in should_run:
|
||||
coresys.core.state = state
|
||||
await coresys.core.set_state(state)
|
||||
await privileged()
|
||||
evaluate.assert_called_once()
|
||||
evaluate.reset_mock()
|
||||
|
||||
for state in should_not_run:
|
||||
coresys.core.state = state
|
||||
await coresys.core.set_state(state)
|
||||
await privileged()
|
||||
evaluate.assert_not_called()
|
||||
evaluate.reset_mock()
|
||||
|
||||
Reference in New Issue
Block a user