1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2025-12-24 20:35:55 +00:00

Handle Unhealthy like Unsupported (#2255)

* Handle Unhealthy like Unsupported

* Add tests

* Add unhealthy to sentry

* Add test
This commit is contained in:
Pascal Vizeli
2020-11-14 16:16:00 +01:00
committed by GitHub
parent 7ee5737f75
commit 2040102e21
14 changed files with 101 additions and 16 deletions

View File

@@ -17,6 +17,7 @@ from supervisor.resolution.const import (
ContextType,
IssueType,
SuggestionType,
UnhealthyReason,
UnsupportedReason,
)
from supervisor.resolution.data import Issue, Suggestion
@@ -25,8 +26,8 @@ from supervisor.utils.dt import utcnow
from supervisor.utils.tar import SecureTarFile
def test_properies(coresys: CoreSys):
"""Test resolution manager properties."""
def test_properies_unsupported(coresys: CoreSys):
"""Test resolution manager properties unsupported."""
assert coresys.core.supported
@@ -34,6 +35,15 @@ def test_properies(coresys: CoreSys):
assert not coresys.core.supported
def test_properies_unhealthy(coresys: CoreSys):
"""Test resolution manager properties unhealthy."""
assert coresys.core.healthy
coresys.resolution.unhealthy = UnhealthyReason.SUPERVISOR
assert not coresys.core.healthy
async def test_clear_snapshots(coresys: CoreSys, tmp_path):
"""Test snapshot cleanup."""
for slug in ["sn1", "sn2", "sn3", "sn4", "sn5"]: