Skip to content

Commit 63cdbe5

Browse files
committed
Add unit tests for default ServiceInfo properties.
1 parent 0111e11 commit 63cdbe5

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

test_zeroconf.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,18 @@ def test_service_info_dunder(self):
9090
assert not info != info
9191
repr(info)
9292

93+
def test_service_info_text_properties_not_given(self):
94+
type_ = "_test-srvc-type._tcp.local."
95+
name = "xxxyyy"
96+
registration_name = "%s.%s" % (name, type_)
97+
info = ServiceInfo(
98+
type_=type_, name=registration_name,
99+
address=socket.inet_aton("10.0.1.2"),
100+
port=80, server="ash-2.local.")
101+
102+
assert isinstance(info.text, bytes)
103+
repr(info)
104+
93105
def test_dns_outgoing_repr(self):
94106
dns_outgoing = r.DNSOutgoing(r._FLAGS_QR_QUERY)
95107
repr(dns_outgoing)

0 commit comments

Comments
 (0)