Check badly formatted dhcp addresses in tests

This commit is contained in:
epenet 2025-06-30 14:41:42 +00:00
parent c4d742f549
commit 562f47147e

View File

@ -18,3 +18,9 @@ class DhcpServiceInfo(BaseServiceInfo):
as a lowercase string without colons.
eg. "AA:BB:CC:12:34:56" is stored as "aabbcc123456"
"""
def __post_init__(self) -> None:
"""Post-init processing."""
# Ensure macaddress is always a lowercase string without colons
if self.macaddress != self.macaddress.lower().replace(":", ""):
raise ValueError("macaddress is not correctly formatted")