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

Supervisor updated before addon repositories (#3795)

This commit is contained in:
Mike Degatano
2022-08-17 01:28:06 -04:00
committed by GitHub
parent e6dfe83d62
commit 5fc9484f73
4 changed files with 44 additions and 5 deletions

View File

@@ -1,9 +1,12 @@
"""Test store manager."""
from unittest.mock import patch
from unittest.mock import PropertyMock, patch
import pytest
from supervisor.bootstrap import migrate_system_env
from supervisor.const import ATTR_ADDONS_CUSTOM_LIST
from supervisor.coresys import CoreSys
from supervisor.exceptions import StoreJobError
from supervisor.store import StoreManager
from supervisor.store.repository import Repository
@@ -100,3 +103,11 @@ async def test_load_from_core_config(coresys: CoreSys):
coresys.config.save_data.assert_called_once()
coresys.store.save_data.assert_called_once()
async def test_reload_fails_if_out_of_date(coresys: CoreSys):
"""Test reload fails when supervisor not updated."""
with patch.object(
type(coresys.supervisor), "need_update", new=PropertyMock(return_value=True)
), pytest.raises(StoreJobError):
await coresys.store.reload()