mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-12-24 20:35:55 +00:00
Backup and restore track progress in job (#4503)
* Backup and restore track progress in job * Change to stage only updates and fix tests * Leave HA alone if it wasn't restored * skip check HA stage message when we don't check * Change to helper to get current job * Fix tests * Mark jobs as internal to skip notifying HA
This commit is contained in:
@@ -371,6 +371,12 @@ async def coresys(
|
||||
await coresys_obj.websession.close()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def ha_ws_client(coresys: CoreSys) -> AsyncMock:
|
||||
"""Return HA WS client mock for assertions."""
|
||||
return coresys.homeassistant.websocket._client
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
async def tmp_supervisor_data(coresys: CoreSys, tmp_path: Path) -> Path:
|
||||
"""Patch supervisor data to be tmp_path."""
|
||||
@@ -516,6 +522,18 @@ def install_addon_ssh(coresys: CoreSys, repository):
|
||||
yield addon
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def install_addon_example(coresys: CoreSys, repository):
|
||||
"""Install local_example add-on."""
|
||||
store = coresys.addons.store["local_example"]
|
||||
coresys.addons.data.install(store)
|
||||
coresys.addons.data._data = coresys.addons.data._schema(coresys.addons.data._data)
|
||||
|
||||
addon = Addon(coresys, store.slug)
|
||||
coresys.addons.local[addon.slug] = addon
|
||||
yield addon
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
async def mock_full_backup(coresys: CoreSys, tmp_path) -> Backup:
|
||||
"""Mock a full backup."""
|
||||
|
||||
Reference in New Issue
Block a user