mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-10-16 15:19:40 +00:00
Allow adoption of existing data disk (#4991)
* Allow adoption of existing data disk * Fix existing tests * Add test cases and fix image issues * Fix addon build test * Run checks during setup not startup * Addon load mimics plugin and HA load for docker part * Default image accessible in except
This commit is contained in:
@@ -62,3 +62,33 @@ async def test_api_set_options(api_client: TestClient, coresys: CoreSys):
|
||||
result = await resp.json()
|
||||
assert result["data"]["watchdog"] is False
|
||||
assert result["data"]["backups_exclude_database"] is True
|
||||
|
||||
|
||||
async def test_api_set_image(api_client: TestClient, coresys: CoreSys):
|
||||
"""Test changing the image for homeassistant."""
|
||||
assert (
|
||||
coresys.homeassistant.image == "ghcr.io/home-assistant/qemux86-64-homeassistant"
|
||||
)
|
||||
assert coresys.homeassistant.override_image is False
|
||||
|
||||
with patch.object(HomeAssistant, "save_data"):
|
||||
resp = await api_client.post(
|
||||
"/homeassistant/options",
|
||||
json={"image": "test_image"},
|
||||
)
|
||||
|
||||
assert resp.status == 200
|
||||
assert coresys.homeassistant.image == "test_image"
|
||||
assert coresys.homeassistant.override_image is True
|
||||
|
||||
with patch.object(HomeAssistant, "save_data"):
|
||||
resp = await api_client.post(
|
||||
"/homeassistant/options",
|
||||
json={"image": "ghcr.io/home-assistant/qemux86-64-homeassistant"},
|
||||
)
|
||||
|
||||
assert resp.status == 200
|
||||
assert (
|
||||
coresys.homeassistant.image == "ghcr.io/home-assistant/qemux86-64-homeassistant"
|
||||
)
|
||||
assert coresys.homeassistant.override_image is False
|
||||
|
Reference in New Issue
Block a user