Skip to content

Commit 4934f83

Browse files
committed
Add options test
1 parent ef84b30 commit 4934f83

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

aiohasupervisor/root.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def homeassistant(self) -> HomeAssistantClient:
4343
"""Get Home Assistant component client."""
4444
return self._homeassistant
4545

46+
@property
4647
def os(self) -> OSClient:
4748
"""Get OS component client."""
4849
return self._os

tests/test_os.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
from pathlib import PurePath
44

55
from aioresponses import aioresponses
6+
import pytest
67
from yarl import URL
78

89
from aiohasupervisor import SupervisorClient
910
from aiohasupervisor.models import (
1011
BootSlotName,
1112
GreenOptions,
1213
MigrateDataOptions,
14+
OSUpdate,
1315
SetBootSlotOptions,
1416
YellowOptions,
1517
)
@@ -37,12 +39,15 @@ async def test_os_info(
3739
assert info.boot_slots["B"].version == "13.0"
3840

3941

42+
@pytest.mark.parametrize("options", [None, OSUpdate(version="13.0")])
4043
async def test_os_update(
41-
responses: aioresponses, supervisor_client: SupervisorClient
44+
responses: aioresponses,
45+
supervisor_client: SupervisorClient,
46+
options: OSUpdate | None,
4247
) -> None:
4348
"""Test OS update API."""
4449
responses.post(f"{SUPERVISOR_URL}/os/update", status=200)
45-
assert await supervisor_client.os.update() is None
50+
assert await supervisor_client.os.update(options) is None
4651
assert responses.requests.keys() == {("POST", URL(f"{SUPERVISOR_URL}/os/update"))}
4752

4853

0 commit comments

Comments
 (0)