mirror of
https://github.com/home-assistant/supervisor.git
synced 2026-04-02 08:12:47 +01:00
The core_security check (HA < 2021.1.5 with custom components) and the ResolutionNotify class that created persistent notifications for it are no longer needed. The minimum supported HA version is well past 2021.1.5, so this check can never trigger. The notify module was the only consumer of persistent notifications and had no other users. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
23 lines
779 B
Python
23 lines
779 B
Python
"""Test checks."""
|
|
|
|
from unittest.mock import Mock, patch
|
|
|
|
from supervisor.const import CoreState
|
|
from supervisor.coresys import CoreSys
|
|
from supervisor.resolution.checks.free_space import CheckFreeSpace
|
|
from supervisor.utils import check_exception_chain
|
|
|
|
|
|
async def test_check_system_error(coresys: CoreSys, capture_exception: Mock):
|
|
"""Test error while checking system."""
|
|
await coresys.core.set_state(CoreState.STARTUP)
|
|
|
|
with (
|
|
patch.object(CheckFreeSpace, "run_check", side_effect=ValueError),
|
|
patch("shutil.disk_usage", return_value=(42, 42, 2 * (1024.0**3))),
|
|
):
|
|
await coresys.resolution.check.check_system()
|
|
|
|
capture_exception.assert_called_once()
|
|
assert check_exception_chain(capture_exception.call_args[0][0], ValueError)
|