Skip to content

Commit b839645

Browse files
committed
Add test for update with version
1 parent d7a53fa commit b839645

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

tests/test_supervisor.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
from ipaddress import IPv4Address
44

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

89
from aiohasupervisor import SupervisorClient
9-
from aiohasupervisor.models import SupervisorOptions
10+
from aiohasupervisor.models import SupervisorOptions, SupervisorUpdateOptions
1011

1112
from . import load_fixture
1213
from .const import SUPERVISOR_URL
@@ -60,12 +61,17 @@ async def test_supervisor_stats(
6061
assert stats.memory_percent == 6.26
6162

6263

64+
@pytest.mark.parametrize(
65+
"options", [None, SupervisorUpdateOptions(version="2024.01.0")]
66+
)
6367
async def test_supervisor_update(
64-
responses: aioresponses, supervisor_client: SupervisorClient
68+
responses: aioresponses,
69+
supervisor_client: SupervisorClient,
70+
options: SupervisorUpdateOptions | None,
6571
) -> None:
6672
"""Test supervisor update API."""
6773
responses.post(f"{SUPERVISOR_URL}/supervisor/update", status=200)
68-
assert await supervisor_client.supervisor.update() is None
74+
assert await supervisor_client.supervisor.update(options) is None
6975
assert responses.requests.keys() == {
7076
("POST", URL(f"{SUPERVISOR_URL}/supervisor/update"))
7177
}

0 commit comments

Comments
 (0)