Fix test failures.
This commit is contained in:
parent
cca682b43d
commit
baa71e4104
1 changed files with 8 additions and 8 deletions
|
@ -195,18 +195,18 @@ class SRV(Record):
|
||||||
|
|
||||||
self.data = f"{self.priority} {self.weight} {self.port} {self.target}"
|
self.data = f"{self.priority} {self.weight} {self.port} {self.target}"
|
||||||
|
|
||||||
#@dataclass
|
@dataclass
|
||||||
class Zone:
|
class Zone:
|
||||||
"""Represents a DNS zone containing multiple records."""
|
"""Represents a DNS zone containing multiple records."""
|
||||||
origin: str
|
origin: str = 'example.com'
|
||||||
records:list = []
|
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."""
|
"""Initializes a zone with the given origin and ensures it ends with a dot."""
|
||||||
if origin[-1] != '.':
|
if self.origin[-1] != '.':
|
||||||
self.origin = origin + '.'
|
self.origin = self.origin + '.'
|
||||||
else:
|
|
||||||
self.origin = origin
|
#self.records: list = field(default_factory=list)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
"""Returns a string representation of the zone."""
|
"""Returns a string representation of the zone."""
|
||||||
|
|
Loading…
Add table
Reference in a new issue