|
3 | 3 | from ipaddress import IPv4Address |
4 | 4 |
|
5 | 5 | from aioresponses import aioresponses |
| 6 | +import pytest |
6 | 7 | from yarl import URL |
7 | 8 |
|
8 | 9 | from aiohasupervisor import SupervisorClient |
9 | | -from aiohasupervisor.models import SupervisorOptions |
| 10 | +from aiohasupervisor.models import SupervisorOptions, SupervisorUpdateOptions |
10 | 11 |
|
11 | 12 | from . import load_fixture |
12 | 13 | from .const import SUPERVISOR_URL |
@@ -60,12 +61,17 @@ async def test_supervisor_stats( |
60 | 61 | assert stats.memory_percent == 6.26 |
61 | 62 |
|
62 | 63 |
|
| 64 | +@pytest.mark.parametrize( |
| 65 | + "options", [None, SupervisorUpdateOptions(version="2024.01.0")] |
| 66 | +) |
63 | 67 | async def test_supervisor_update( |
64 | | - responses: aioresponses, supervisor_client: SupervisorClient |
| 68 | + responses: aioresponses, |
| 69 | + supervisor_client: SupervisorClient, |
| 70 | + options: SupervisorUpdateOptions | None, |
65 | 71 | ) -> None: |
66 | 72 | """Test supervisor update API.""" |
67 | 73 | 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 |
69 | 75 | assert responses.requests.keys() == { |
70 | 76 | ("POST", URL(f"{SUPERVISOR_URL}/supervisor/update")) |
71 | 77 | } |
|
0 commit comments