Fix test failures.
Some checks failed
ci/woodpecker/push/package-deploy Pipeline was successful
ci/woodpecker/tag/package-deploy Pipeline failed

This commit is contained in:
minecraftchest1@outlook.com 2025-01-26 13:31:10 -06:00
parent cca682b43d
commit baa71e4104

View file

@ -195,18 +195,18 @@ class SRV(Record):
self.data = f"{self.priority} {self.weight} {self.port} {self.target}"
#@dataclass
@dataclass
class Zone:
"""Represents a DNS zone containing multiple records."""
origin: str
records:list = []
origin: str = 'example.com'
records: list = field(default_factory=list)
def __init__(self, origin: str):
def __post_init__(self):
"""Initializes a zone with the given origin and ensures it ends with a dot."""
if origin[-1] != '.':
self.origin = origin + '.'
else:
self.origin = origin
if self.origin[-1] != '.':
self.origin = self.origin + '.'
#self.records: list = field(default_factory=list)
def __str__(self):
"""Returns a string representation of the zone."""