1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2025-12-24 04:19:03 +00:00

Fix add-on is not installed anymore (#2656)

* Fix add-on is not installed anymore

* Fix and add tests
This commit is contained in:
Pascal Vizeli
2021-03-01 17:19:38 +01:00
committed by GitHub
parent 43449c85bb
commit 33385b46a7
2 changed files with 9 additions and 1 deletions

View File

@@ -14,6 +14,7 @@ class TestAddon:
slug = "my_test"
pwned = set()
state = AddonState.STARTED
is_installed = True
async def test_check(coresys: CoreSys):
@@ -78,6 +79,13 @@ async def test_approve(coresys: CoreSys):
):
assert not await addon_pwned.approve_check(reference=addon.slug)
addon.is_installed = False
with patch(
"supervisor.resolution.checks.addon_pwned.check_pwned_password",
AsyncMock(return_value=True),
):
assert not await addon_pwned.approve_check(reference=addon.slug)
async def test_did_run(coresys: CoreSys):
"""Test that the check ran as expected."""