Skip to content

Commit d7a53fa

Browse files
committed
Use IPv4Address for ip address
1 parent 5e26ac9 commit d7a53fa

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

aiohasupervisor/models/supervisor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Models for supervisor component."""
22

33
from dataclasses import dataclass
4+
from ipaddress import IPv4Address
45

56
from .base import ContainerStats, Options, Request, ResponseData
67
from .root import LogLevel, UpdateChannel
@@ -17,7 +18,7 @@ class SupervisorInfo(ResponseData):
1718
arch: str
1819
supported: bool
1920
healthy: bool
20-
ip_address: str
21+
ip_address: IPv4Address
2122
timezone: str | None
2223
logging: LogLevel
2324
debug: bool

tests/test_supervisor.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""Test for supervisor management client."""
22

3+
from ipaddress import IPv4Address
4+
35
from aioresponses import aioresponses
46
from yarl import URL
57

@@ -38,6 +40,7 @@ async def test_supervisor_info(
3840
assert info.supported is True
3941
assert info.healthy is True
4042
assert info.logging == "info"
43+
assert info.ip_address == IPv4Address("172.30.32.2")
4144

4245

4346
async def test_supervisor_stats(

0 commit comments

Comments
 (0)